阅读背景:

取出结构体变量中的每一个成员的两种方式

来源:互联网 

如何取出结构体中的每一个成员变量:

#include <stdio.h>
struct Student
{
   int age;
   float score;
   char sex;
};
int main(void)
{
    struct Student st = {80, 66.6F, 'F'};
    struct Student * pst = &st;
    pst->age = 88;
    st.score = 66.7f;
    printf("%d %f\n", st.age, pst->score);
    return 0;
}
#include <stdio.h>
str



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: