Escaping a # symbol in a #define macro?

It is possible to insert a hash token into the preprocessed token stream. You can do it as follows: #define MACRO(hash, name) hash include name MACRO(#,”hello”) —expands to: # include “hello” However, the standard explicitly rules out any further analysis of such line for the existence of preprocessing directives [cpp.rescan]: The resulting completely macro-replaced preprocessing … Read more

How are the __cplusplus directive defined in various compilers?

The 199711L stands for Year=1997, Month = 11 (i.e., November of 1997) — the date when the committee approved the standard that the rest of the ISO approved in early 1998. For the 2003 standard, there were few enough changes that the committee (apparently) decided to leave that value unchanged. For the 2011 standard, it’s … Read more

Is there a preprocessor directive for detecting C++11x support? [duplicate]

__cplusplus should be defined as 199711L in pre-C++11 compilers, 201103L in those suporting C++11. Whether this is much help in practice is another question: most compilers are only halfway there, so shouldn’t be defining it as 201103L, even if they support the features you are interested in. And it’s not unheard of for a compiler … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)