![]() |
Can someone explain this pgm?
Code:
#include <stdio.h>Can someone please explain how it is been executed?... thanks in advance |
Re: Can someone explain this pgm?
I'm not clear exactly what you want to know. What output do you get and what are you expecting? If you don't use pointers, what output do you get and what output did you expect?
Don't forget the difference between call by value and call by reference. C is always "call by value", which is why pointers are needed when you want a function to modify something that is passed to it. |
Re: Can someone explain this pgm?
basically is it a simple program where the function "func" takes 3 arguments x,y,z, but rather than taking the values it take reference to the pointers of the value
the difference is when you pass a value is c/c++ the porgram makes a copy of the variable in a new memory location and then do every stuff but im this case the program just passes a pointer that points to the memory address of the variables and any change done to the variables though the function would affect the actual variables the logic of the function is quite simple as it just add up the things but the function getchars is not given |
| All times are GMT +5.5. The time now is 12:06. |