How many operators can you put together, when you really put your mind to it? This Item takes a break from production coding to get some fun C++ exercise.
JG Question
What is the greatest number of plus signs (+) that can appear consecutively, without intervening whitespace, in a valid C++ program?
Note: Of course, plus signs in comments, preprocessor directives and macros, and literals don't count. That would be too easy.
Guru Question
Similarly, what is the greatest number of each of the following characters that can appear consecutively, without whitespace, outside comments in a valid C++ program?
&
<
|
For example, for (a), the code if(a && b) trivially demonstrates two consecutive & characters ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.