trigraphs

C++ alternative tokens?

I've just read this nice piece from reddit. They mention "and" and "or" being "Alternative Tokens" to && and || I was really unaware of these just till now. Of course, everybody knows about the di-graphs and tri-graphs but "and" and "or"? Seriously? Since when? Is this a recent addition to the standard? I've just checked it with Visua...

Purpose of Trigraph sequences in C++?

According to C++'03 Standard 2.3/1: Before any other processing takes place, each occurrence of one of the following sequences of three characters (“trigraph sequences”) is replaced by the single character indicated in Table 1. ---------------------------------------------------------------------------- | trigraph | replacement | t...

Escape sequence for ? in c++

Hi, I was looking at the escape sequences for characters in strings in c++ and I noticed there is an escape sequence for a question mark. Can someone tell me why this is? It just seems a little odd and I can't figure out what ? does in a string. Thanks. ...

Unknown meta-character in C/C++ string literal ?

I created a new project with the following code segment: char* strange = "(Strange??)"; cout << strange << endl; resulting in the following output: (Strange] Thus translating '??)' -> ']' Debugging it shows that my char* string literal is actually that value and it's not a stream translation. This is obviously not a meta-charac...

Print ?? and !! in different sequence will show different output

I had found a strange output when I write the following lines in very simple way: Code: printf("LOL??!\n"); printf("LOL!!?\n"); Output: It happens even the code is compiled under both MBCS and UNICODE. The output varies on the sequence of "?" and "!"... Any idea? ...