你看到它用于for循环语句,但它在任何地方都是合法的语法.您在其他地方找到了什么用途,如果有的话?
int main(void)
{
int a=0, b=20;
char x=1, y=10;
if(a,b,x,y)
printf("bye");
return 0;
}
Run Code Online (Sandbox Code Playgroud)
上述代码中的"if"条件如何工作?"y"的值是否仅被"if"视为?
我要检查if的/经营者有没有剩余或不:
int x = 0;
if (x = 16 / 4), if there is no remainder:
then x = x - 1;
if (x = 16 / 5), if remainder is not zero:
then x = x + 1;
Run Code Online (Sandbox Code Playgroud)
如何检查是否有剩余C?以及
如何实施它?
我已经读过,逗号运算符用于赋值表达式,右表达式提供给左值.
但是为什么这个程序在不使用括号时将左表达式赋值给左值.我正在使用turbo c编译器
int b=2;
int a;
a=(b+2,b*5); // prints 10 as expected
a=b+2,b*5; // prints 4 when not using parenthesis
Run Code Online (Sandbox Code Playgroud)
以下工作
int a =(b+2,b*5);
Run Code Online (Sandbox Code Playgroud)
这会产生错误,我无法理解原因.
int a =b+2,b*5; // Error
Run Code Online (Sandbox Code Playgroud) 我正在寻找一些例子,我不知道这意味着什么:
if(FileExistsA("File.ext"), false)
{
....
}
Run Code Online (Sandbox Code Playgroud)
有人可以解释一下吗?