-1
这段代码有什么问题?为什么循环条件不会循环执行?这让我疯狂!我看不到的问题:C++:循环条件连续执行时,循环体永不执行
bool test() { std::cout << "condition!" << std::endl; return true; }
while(test());
{
std::cout << "This message never appears!!!" << std::endl;
}
输出:
condition!
condition!
condition!
...forever