初始化問題啊
為什么這樣初始化不行呢
?1 #include <stdio.h>
? 2
? 3 typedef struct {
? 4 ? int price;
? 5 ? char name[10];
? 6 ? int atk;
? 7 } weapon_t;
? 8
? 9 int main(){
?10 ? weapon_t a;
?11 ? a.name="we";
?12 ? a.price=33;
?13 ? a.atk=99;
?14 ? return 0;
?15 }
為什么這樣初始化不行呢
?1 #include <stdio.h>
? 2
? 3 typedef struct {
? 4 ? int price;
? 5 ? char name[10];
? 6 ? int atk;
? 7 } weapon_t;
? 8
? 9 int main(){
?10 ? weapon_t a;
?11 ? a.name="we";
?12 ? a.price=33;
?13 ? a.atk=99;
?14 ? return 0;
?15 }
2016-08-09
舉報
2016-08-10