My C++ Quiz

The ultimate place for testing what you have learned



Home | Start Quiz | List of questions  | Next Question | Login / Register

Question #29: If assumptions in the code below are true what value would be the final value printed by this program?
39% on 1825 times asked

int main(int argc, char** argv)
{
  // assume result printed is 4
  std::cout << sizeof(int) << std::endl;

  int *x = new int;
  
  // assume result printed is 0x60000000
  std::cout << x << std::endl;

  std::cout << x + 3 << std::endl;

  return 0;
}

0x60000000
0x60000003
0x6000000C
implementation defined
undefined
© 2007-2010, My C++ Quiz, All rights reserved.
Can you find a bug in the quiz? Can you think of a new question that would be cool to add to this site? Email us and we will take action:
email us
Other Quizes | Contributors