Interview Question
void main(){
putchar( a( ‘x’, b( ‘y’ ) ) );
}char a( char a, char* b ){
return *b;
}char* b( char a ){
return &a;
}
What’s wrong with the code above? What would it return in a typical x86 system? This was a question that I came up with yesterday, but now that I’ve used it and thought about it, I don’t think it’s completely fair… I guess this one goes into the garbage can. I thought of another good interview question, but I’m gonna use that one in future interviews so I suppose I can’t divulge it here. Who knows, maybe they’ll google me before they come in for the interview. ![]()