摘要:
->这个符号是结构体运算符每一个结构体变量中的各个成员,都可以通过结构体成员运算符“.”或“->”来逐个访问。例如:定义一个结构体struct student{char name[10];char number[10];float score;}stu1;然后访问其中成员,比如给成员赋值stu1.score=65.5;同样也可以写成stu1->score=65.5;结构体主要成员运算符有"."和" ->"多用于修改结构成员的值。以下是具体的例子struct date{ int year; int month; int day;}; 阅读全文