+=
-=
*=
/=
%=
>>=
<<=
&=
|=
^=
sizeof
&:取地址操作符
*:解引用操作符
(类型):(强制类型转换)
#includevoid test1(int arr[]) { printf("%dn", sizeof(arr));//(2) } void test2(char ch[]) { printf("%dn", sizeof(ch));//(4) } int main() { int arr[10] = {0}; char ch[10] = {0}; printf("%dn", sizeof(arr));//(1) printf("%dn", sizeof(ch));//(3) test1(arr); test2(ch); return 0; }
i为真时就不用算了
-
2.( ) 函数调用操作符
接受一个或者多个操作数:第一个操作数是函数名,剩余的操作数就是传递给函数的参数。
#includevoid test1() { printf("hehen"); } void test2(const char *str) { printf("%sn", str); } int main() { test1(); //实用()作为函数调用操作符。 test2("hello bit.");//实用()作为函数调用操作符。 return 0; }
#includestruct Stu { char name[10]; int age; char sex[5]; double score; }; void set_age1(struct Stu stu) { stu.age = 18; } void set_age2(struct Stu* pStu) { pStu->age = 18;//结构成员访问 } int main() { struct Stu stu; struct Stu* pStu = &stu;//结构成员访问 stu.age = 20;//结构成员访问 set_age1(stu); pStu->age = 20;//结构成员访问 set_age2(pStu); return 0;



