My C++ Quiz

The ultimate place to learn C++!

Question #74: What should get printed in the program below?

#include <iostream>
using namespace std;

class foo{
public:
    foo() : z(x+1), y(2), x(3)
    {
        cout << "z: " << z << endl;
    }
private:
    int x;
    int y;
    int z;
};

int main(int argc, char** argv){
    foo f;
    return 0;
}