Skip to main content
Journey Uncommon Logo
JourneyUncommon
easyC++references vs pointersSingle-choice MCQ

What does this function print when called as `inc(x)` with `int x = 5;`?

void inc(int* p) { p = p + 1; } // caller: int x = 5; inc(&x); std::cout << x;