cppreference.com > C/C++ Pre-processor Commands > #, ##
#, ##

The # and ## operators are used with the #define macro. Using # causes the first argument after the # to be returned as a string in quotes. For example, the command

   #define to_string( s ) # s
		

will make the compiler turn this command

   cout << to_string( Hello World! ) << endl;
		

into

   cout << "Hello World!" << endl;
		

Using ## concatenates what's before the ## with what's after it. For example, the command

   #define concatenate( x, y ) x ## y
   ...
   int xy = 10;
   ...
		

will make the compiler turn

   cout << concatenate( x, y ) << endl;
		

into

   cout << xy << endl;
		

which will, of course, display '10' to standard output.