Parameter passing by pointer
Posted on 2006-04-05
Hi Experts, I am having some problem with the following simple program.
the structure member a is not changed after CheckOne is called. Why it is not working.
The output is 5, instead of 100.
CheckOne( my_struct * val );
MyClass::CheckOne(my_struct * val )
val->a = 100;
some.a = 5;
printf("int val = %d\n", some.a );