[問題] 程式的小錯誤..

看板C_and_CPP作者 (訪問上帝)時間15年前 (2009/06/05 13:39), 編輯推噓1(103)
留言4則, 3人參與, 最新討論串1/1
#include <stdio.h> int main(void) { struct status { unsigned sex:1; unsigned marriage:1; unsigned age:7; unsigned height:8; unsigned weight:8; }; struct status maruco={0,0,19,162,50}; if(maruco.sex==0) printf("姓別:女,"); else printf("姓別:男,"); if(maruco.marriage==0) printf("未婚,"); else printf("已婚,"); printf("%d 歲,身高%d 公分,",maruco.age,maruco.height); printf("體重%d 公斤\n",maruco.weight); printf("sizeof(maruco)=%d\n",sizeof(maruco)); system ("pause"); <---------這行出錯了...哈..請問是為什麼呀..我搞不懂.. return 0; } 謝謝解答 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 118.170.87.225

06/05 13:42, , 1F
#include <stdlib.h>
06/05 13:42, 1F

06/05 13:44, , 2F
樓上..太感激你了..謝謝謝謝謝謝謝謝謝你
06/05 13:44, 2F

06/05 14:49, , 3F
有error看一下error message, 也最好一起貼上來....
06/05 14:49, 3F

06/05 14:49, , 4F
很多問題與答案其實compiler的error message都告訴你了.
06/05 14:49, 4F
文章代碼(AID): #1AAA-Yzr (C_and_CPP)