Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

  std::cout << "This does what??!" << endl;
If you're using namespace std then it's obvious (note that this is considered bad practice), assuming you haven't overridden <<, but otherwise it depends on endl's type and value. Maybe you meant std::endl?


You may also be surprised that "??!" is a trigraph for "|" in case your keyboard doesn't have one. I am not making this up.


Ohhhh... GCC warns about trigraphs, so I tend to forget about them, but wow did I fall for that one.

C++ is a wonderful language for people who like puzzles, and it's also good for making fun of know-it-alls.


> C++ is a wonderful language for people who like puzzles, and it's also good for making fun of know-it-alls.

Except trigraphs are another wart inherited from C (ANSI C section 5.2.1.1 A).


The fact that the C++ preprocessor deals with that trigraph case inside quote marks does not have anything to do with what foobarbazqux said about std::endl.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: