[問題] 怎麼解決左元運算值必須為左值(c語言結構)???
( *[1m *[m 為色碼,可以按 Ctrl+V 預覽會顯示的顏色 )
( 未必需要依照此格式,文章條理清楚即可 )
以下為程式碼
struct Food
{
char name[50];
double carbohydrate, protein, fat, other,kcal;
char fruit;
};
struct Food2
{
char name[50],name2[50];
double carbohydrate, protein, fat, other,kcal,g[50];
char foodla[50][50];
int foodCount;
};
主函式
struct Food a[10];
struct Food2 temp;
temp.foodla[temp.foodCount]=a[0].name;
為什麼沒辦法把a結構裡的第0項食物名稱
複製到temp結構裡???
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 203.72.84.170
→
03/23 13:15, , 1F
03/23 13:15, 1F
→
03/23 13:18, , 2F
03/23 13:18, 2F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章