1. 程式人生 > >關於定義結構體的應用

關於定義結構體的應用

define _CRT_SECURE_NO_WARNINGS

include <stdio.h>

include <stdlib.h>

include <string.h>

//# include<str .h>
struct student{
char name[1024];
int score;
};
int main(){
struct student student1;
/student1.name[0] = ‘c’;
student1.name[1] = ‘y’;
student1.name[2] = ‘\0’;
student1.score = 100;

/
strcpy(student1.name, “chenyongjie”);
printf(“name=%s,score=%d\n”,student1.name,student1.score);
system (“pause”);
return 0;
}