I can’t believe this works!

Are you bored? Try pasting this, as is, in a cpp file:

// What is going on here??/
Is this even legal C++??/
Yes, it is!

NB: You may have to use -trigraphs to compile this. Try it out! You can use this command:

echo -e “// What is going on here??/Is this legal C++?” | g++ -E -c -trigraphs –

With some luck, this won’t be legal C++ anymore after C++ 17 deprecates trigraphs.

Advertisements


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s