[問題] 結構內字串的初始化
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
問題(Question):想請問以下的code:
餵入的資料(Input):
預期的正確結果(Expected Output):原本預期的結果是結構內所有字串都能
被初始化
錯誤結果(Wrong Output):但是卻出現syntax error before '{'token以及
syntax error before '}'token這些錯誤
程式碼(Code):(請善用置底文網頁, 記得排版)
struct STUDENT
{
int id;
char name[80];
int take_num;
int takes[6];
};
void init(struct STUDENT students[])
{
int i,j;
for(i=1;i<256;i++)
{
students[i].id=-1;
students[i].name[80]={0};
}
}
補充說明(Supplement):請問這應該如何修改呢??
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 111.251.186.10
推
02/04 13:48, , 1F
02/04 13:48, 1F
推
02/04 14:13, , 2F
02/04 14:13, 2F
→
02/04 14:20, , 3F
02/04 14:20, 3F
→
02/04 14:20, , 4F
02/04 14:20, 4F
→
02/04 14:25, , 5F
02/04 14:25, 5F
→
02/04 14:26, , 6F
02/04 14:26, 6F
→
02/04 14:34, , 7F
02/04 14:34, 7F
→
02/04 14:34, , 8F
02/04 14:34, 8F
→
02/04 14:47, , 9F
02/04 14:47, 9F
→
02/04 14:50, , 10F
02/04 14:50, 10F
→
02/04 14:52, , 11F
02/04 14:52, 11F
→
02/04 15:36, , 12F
02/04 15:36, 12F
→
02/04 15:39, , 13F
02/04 15:39, 13F