/*C語言 結構變數設定初值*/
#include<stdio.h>
#include<stdlib.h>
int main(void)
{
struct data
//定義結構
{
char name[10];
int score;
}student = {"Jackson", 81};
printf("姓名:%s\n", student.name);
printf("分數:%d\n", student.score);
system("pause");
return 0;
}
結果為:
文章標籤
全站熱搜