看板 ASM 關於我們 聯絡資訊
※ 引述《BlueFeel (藍色感覺)》之銘言: : /* Define Variable */ : #define a 0x0000 : #define c 0x0001 : #define c 0x0002 : void Main(void) : { : Hardware_Iinitialize(); : Hello(a,b,c); : } : void Hello(a_Value,b_Value,c_Value) : { : unsigned char index; : unsigned short Reg[] = {a_Value , b_Value , c_Value}; : for (index = 0; index < 15 ; index++) : { : ......... : } : } : =================================== : 為什麼軟體告訴我..... : MAIN.C(70): error C247: non-address/-constant initializer : why?? : 怎麼寫才對呢? void Hello(unsigned short a_Value,unsigned short b_Value,unsigned short c_Value) { unsigned char index; unsigned short Reg[] = {a_Value , b_Value , c_Value}; for (index = 0; index < 15 ; index++) { ......... } } 改成這樣還是一樣出縣這個non-address/-constant initializer 真怪 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 123.195.194.110
ksmrt0123:unsigned short Reg[] = {a_Value , b_Value , c_Value} 03/22 21:28
ksmrt0123:不能這樣用. 錯誤訊息要會看 不然你整天上ptt問人就把時 03/22 21:30
ksmrt0123:間花光了. 03/22 21:31
ksmrt0123:MAIN.C(70): error C247: 跟你說第70行發生C247錯誤 03/22 21:31
ksmrt0123:你用keil吧, 在output window該錯誤訊息處點兩下就會直 03/22 21:32
ksmrt0123:接跳到原始檔發生錯誤那行 03/22 21:33
ksmrt0123:non-address/-constant initializer看不懂的話, 先點一 03/22 21:34
ksmrt0123:下output window錯誤訊息始其變反白, 再ctrl-F1可看更詳 03/22 21:35
ksmrt0123:細的說明 03/22 21:35
BlueFeel:原來如此呀! 03/22 21:38