hi,
void f(MyStruct* p)
{
p = new MyStruct;
}
is called like this : f(ptr1);
with ptr1 declared as MyStruct* ptr1;
I think passing the pointer as above is incorrect 'cause
p has a correct value but ptr1 is 0 after the function
call.
so what's wrong ?
thanks in advance
void f(MyStruct* p)
{
p = new MyStruct;
}
is called like this : f(ptr1);
with ptr1 declared as MyStruct* ptr1;
I think passing the pointer as above is incorrect 'cause
p has a correct value but ptr1 is 0 after the function
call.
so what's wrong ?
thanks in advance