Spot the mistake:
int foo(vector<int>& stack)
{
int x = stack.back();
stack.pop_back();
}
For reasons I can't begin to understand,
1. This doesn't produce any compile-time error.
2. This function always returns the value "2144912088".
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|