小编use*_*719的帖子

c ++ if(func1()&& func2()),是否必须在func2之前调用func1?

在C++中,如果我编写以下if语句.什么是潜在的问题?行为是否定义明确?谢谢.

int i = 0;
// func1 will return the updated value for i.
// func2 will use the new value of i.
if (func1(i) && func2(i)) { ...}
Run Code Online (Sandbox Code Playgroud)

或者可能&&可以更改为||,呼叫仍然是好的吗?

c++ if-statement

0
推荐指数
1
解决办法
175
查看次数

标签 统计

c++ ×1

if-statement ×1