output
Code:
#include<stdio.h> how is the o/p remaining the same in main() even after we change the pointer's to point to another variable in func()?? |
The parameter is passed by value, so this statement: 'b=&c' changes only the copied value, not the original.
PS: you really should use printf, it is much more flexible, eg: Code:
printf ("main, beforore 'fun': a=%d, p=%p\n", a, p); |
Quote:
Code:
#include<iostream.h> |
Yes, that's how call-by-reference is different to call-by-value.
|
All times are GMT -5. The time now is 06:10 PM. |