跳到主文
部落格全站分類:運動體育
(1) 使用 struct mydata:11 行是以 mydata 宣告了 customer 變數12 行應該就出錯了
12, 13 改為struct mydata *ftp;ftp=( struct mydata *)calloc(10,sizeof( struct mydata));
(2) 使用 typedef:由於 C struct 要連帶 struct ,使用上很麻煩。大多會用 typedef 將 struct tagName 定義新 type。
也就是在第 3 行,加上 typedef,而 customer 成為新 type name,等義於 struct mydata。
int main(void){typedef struct mydata{char name[25];char Address1[30];char Address2[30];int order;char type;char risk;} customer;customer *ftp;ftp=(customer*)calloc(10,sizeof(customer));return 1;}
This entry passed through the Full-Text RSS service — if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers. Five Filters recommends:
線上遊戲排行榜2013/2014,進擊的巨人線上看,candy crush saga外掛,正妹寫真三圍
mkmkmklal 發表在 痞客邦 留言(0) 人氣()