#include <stdio.h>
struct Card {
int number;
char face[];
char suit[];
};
int main(){
Card deck;
deck.number = 5; //for debug
char face[] = "Ace"; //for debug
deck.face[] = "Ace";
deck.suit[] = "Hearts";
printf("s of s\n",deck.face,deck.suit);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgpzdHJ1Y3QgQ2FyZCB7CiAgICBpbnQgbnVtYmVyOwogICAgY2hhciBmYWNlW107CiAgICBjaGFyIHN1aXRbXTsKfTsKCgoKaW50IG1haW4oKXsKICAgIENhcmQgZGVjazsKICAgIGRlY2subnVtYmVyID0gNTsgLy9mb3IgZGVidWcKICAgIGNoYXIgZmFjZVtdID0gIkFjZSI7IC8vZm9yIGRlYnVnCiAgICBkZWNrLmZhY2VbXSA9ICJBY2UiOwogICAgZGVjay5zdWl0W10gPSAiSGVhcnRzIjsKICAgIHByaW50ZigicyBvZiBzXG4iLGRlY2suZmFjZSxkZWNrLnN1aXQpOwogICAgcmV0dXJuIDA7Cn0K
prog.cpp: In function ‘int main()’:
prog.cpp:15:15: error: expected primary-expression before ‘]’ token
deck.face[] = "Ace";
^
prog.cpp:16:15: error: expected primary-expression before ‘]’ token
deck.suit[] = "Hearts";
^
prog.cpp:17:42: warning: too many arguments for format [-Wformat-extra-args]
printf("s of s\n",deck.face,deck.suit);
^
prog.cpp:14:10: warning: unused variable ‘face’ [-Wunused-variable]
char face[] = "Ace"; //for debug
^