Interview Question
Country: United States
x is on stack. You won't be able to access on return. Allocating on heap and then returning the pointer can be one way.
int func(char * c, int a){
c=....; /* pointer to the char so changes will b reflected*/
a=....;
return (a);
}
- Anonymous July 16, 2012