Re: [問題] 陣列問題
※ 引述《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
→
03/22 21:28, , 1F
03/22 21:28, 1F
→
03/22 21:30, , 2F
03/22 21:30, 2F
→
03/22 21:31, , 3F
03/22 21:31, 3F
→
03/22 21:31, , 4F
03/22 21:31, 4F
→
03/22 21:32, , 5F
03/22 21:32, 5F
→
03/22 21:33, , 6F
03/22 21:33, 6F
→
03/22 21:34, , 7F
03/22 21:34, 7F
→
03/22 21:35, , 8F
03/22 21:35, 8F
→
03/22 21:35, , 9F
03/22 21:35, 9F
→
03/22 21:38, , 10F
03/22 21:38, 10F
討論串 (同標題文章)
ASM 近期熱門文章
PTT數位生活區 即時熱門文章