struct student{
    int num;
    char name[20];
    ...;
}

结构体的定义

 

student stud[4];

数组变量的定义

 

void input (student &stud){
    cout<<"请输入xxx:";
    cin>>stud . num;
    cout<<".....";
    cin>>....;
}

void output ( student &stud){
    cout<<".....";
}

for ( int i = 0 ; i<=3 ; i++){
    input (stud[i];
}

for(int i = 0 ; i<=3 ; i++){
    output(stud[i]);
}

结构体数组的使用

 

posted on 2018-11-19 16:31  likeghee  阅读(5549)  评论(0)    收藏  举报