真-非0 假-0 &&-逻辑与
#include<stdio.h>
int main()
{
int a = 2;
int b = 5;
//int c = a && b;//真-非0 假-0 &&-逻辑与
int c = a || b;// | |逻辑或
printf("c = %d\n", c);
return 0;
}
三目操作符(exp1 ? exp2 :exp3)
int main()
{
int a = 10;
int b = 20;
int max = 0;
max = (a > b ? a : b);//三目操作符(exp1 ? exp2 :exp3)
if (a > b)
max = a;
else
max = b;
return 0;
}
[]下标操作符 ()-函数调用操作符
int Add(int x, int y)标签:10,return,int,max,操作符,main From: https://blog.51cto.com/u_15518335/6074444
{
int z = 0;
z = x + y;
return z;
}
int main()
{
//int arr[10] = { 0 };
//arr[4];//[]下标操作符
int a = 10;
int b = 20;
int sum = Add(a, b);//9()-函数调用操作符
printf("sum = %d\n", sum);
return 0;
}