文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档># and ##

# and ##

时间:2010-03-29  来源:liuyuanyang

The # and ## preprocessor operators are used with the #define preprocessor directive.

  • Using # causes the first argument after the # to be returned as a string in quotes.
  • Using ## concatenates what's before the ## with what's after it.

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;

Here is an example of the ## command:

#define concatenate( a, b ) a ## b ... int xy = 10; ...

This code will make the compiler turn

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

into

cout << xy << endl;

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

相关阅读 更多 +
排行榜 更多 +
jojo的奇妙冒险手机版下载

jojo的奇妙冒险手机版下载

飞行射击 下载
雪糕工厂 v9.87.13.02 安卓版

雪糕工厂 v9.87.13.02 安卓版

休闲益智 下载
雪糕工厂 v9.87.13.02 安卓版

雪糕工厂 v9.87.13.02 安卓版

休闲益智 下载