Hacker News new | ask | show | jobs
by bluejekyll 3797 days ago
> What does the C++ code print?

And there it is. I programmed in C++ long enough to "know" this, but I still remember more jr. Engineers and even arguments with more sr. Engineers around this type of question.

Rust has removed this kind of question almost entirely from the language.

Personally, I have no intention of ever going back to C/C++ for any new project I work on.

2 comments

Of course, this has nothing to do with OO, and everything with C++.

  "I invented the term Object-Oriented, and I can tell you I did not have C++ in mind" -- Alan Kay
> What does the C++ code print? If you guessed wrong, don't worry. You're in good company. If you guessed right, congrats!

How do I knowwww????

    $ g++ test.cpp
    $ ./a.out
    EDIT---answer removed to let others guess first.
Or Windows.

Anyway my point was, why force your readers to find and use a compiler when you could just give the answer below? Not sure why I got downvoted.

Aw. As a user on my phone you make me sad.