Struct {
int a;
struct sample *b;
} test;
int func(struct test *t1) {
if (!t1 || !t1->b) { // Is this statement ok?
return _EINVAL
}
...
}
Run Code Online (Sandbox Code Playgroud)
在单个if语句中检查嵌套指针是否可以?我是否可以始终假设将首先执行左检查(在我的示例中为!t1)?
| 归档时间: |
|
| 查看次数: |
75 次 |
| 最近记录: |