There is simple code
int a( int *p0 ) {
int p;
if( p0 ) return p0 > &p;
return a(&p);
}
int main() {
puts( a(0) ? "y" : "n" );
}
What result will be and how many times method a will be called?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Comparing pointers using
>is unspecified if they are not part of the same array.So there is no actual answer, although you can assume if the stack grows down
if( p0 ) return p0 > &p;will be true, otherwise false.