cpp does not compare strings



所有跟贴·加跟贴·新语丝科技论坛

送交者: wasguru 于 2005-7-19, 19:49:36:

回答: #if A == func2 由 neo6 于 2005-7-19, 12:38:20:

instead, all macros are expanded, all non-macro identifiers are considered number zero. Therefore, you code is first expanded to

#if func1 == func2
...

next, func1 and func2 are both non-macro identifiers, they are treated as 0, hence

#if 0 == 0
...

which is of course true!





所有跟贴:


加跟贴

笔名: 密码(可选项): 注册笔名请按这里

标题:

内容(可选项):

URL(可选项):
URL标题(可选项):
图像(可选项):


所有跟贴·加跟贴·新语丝科技论坛