by gengkev · 10y ago · 0 comments
Regarding pointers, though, you have a point that char * is commonly used for statically allocated strings. I concede that it's fair to criticize the interviewee for saying the memory was dynamically allocated (by the compiler??), though I don't know if that rises to the level of "Get out."
Then you would just write it as a function like this:
void foo(char *p) {
*p = 'a';
}