Skip to main content
Journey Uncommon Logo
JourneyUncommon
easyC++const correctnessSingle-choice MCQ

Will this code compile, and why?

struct Counter { int value = 0; int get() const { return value; } void bump() { ++value; } }; void show(const Counter& c) { std::cout << c.get(); c.bump(); }