Struct 宣告:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
struct data{
int a;
char b[10];
};
struct data str = {6,"Eric"};
printf("%d , %d",str.a,str.b);
system("pause");
return 0;
}
取用struct的資料底下只需要使用結構命名的變數即可
沒有留言:
張貼留言