M
Manu
Hi,
Check the following code.
bool Func1(A* ptr = NULL)
{
ptr = Func2();
}
void main()
{
A* ptr1;
Func1(ptr1);
}
In the above case the value of ptr1 will be some junk value.
As a result i modified the code like
bool Func1(A*& ptr)
{
ptr = Func2();
}
Now it works fine.
But I need a function with a default parameter as NULL but at the same time
the parameter has to be passed as reference.
How can I achieve it??
Regards,
R Manu
Check the following code.
bool Func1(A* ptr = NULL)
{
ptr = Func2();
}
void main()
{
A* ptr1;
Func1(ptr1);
}
In the above case the value of ptr1 will be some junk value.
As a result i modified the code like
bool Func1(A*& ptr)
{
ptr = Func2();
}
Now it works fine.
But I need a function with a default parameter as NULL but at the same time
the parameter has to be passed as reference.
How can I achieve it??
Regards,
R Manu