C++ Comparison, What is the outcome? -
there 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 , how many times method a
called?
comparing pointers using >
unspecified if not part of same array.
so there no actual answer, although can assume if stack grows down if( p0 ) return p0 > &p;
true, otherwise false.
Comments
Post a Comment