当我不小心删除了方法名称时,我遇到了这个问题。代码来自
bool bRet = MethodName(pData, pOutFilename);
到
bool bRet = (pData, pOutFilename);
但仍然编译?这段代码有什么作用?这是什么意思?似乎返回true,是否总是这样(即使pData为null)?
欢迎提出任何想法!
最佳答案
它是 "comma operator"其中
evaluates its first operand and discards the result, and then evaluates the second operand and returns this value (and type).
关于c++ - 为什么这个 C++ 代码可以编译?它有什么作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17785206/