My C++ Quiz

The ultimate place to learn C++!

Question #43: What value gets printed by the program?

#include <iostream>

int foo(int x, int y)
{
  return x+y;
}

int foo(const int x, const int y)
{
  return x+y+1;
}

int main(int argc, char** argv)
{
  const int x = 3;
  const int y = 2;

  std::cout << foo(x,y) << std::endl;

  return 0;
}