c - Syntax Error: expected declaration at end of input -
i keep getting strange syntax error i've never seen before, , i'm not sure what's problem it. can eyes me figure out problem is?
the error reads: error: expected declaration or statement @ end of input bold line highlights error.
void draw(int deck[size]) { int i; for(i = 0; < 5; i++) { cards; putchar('\n'); } void cards() { char suits[4][9] = { "hearts", "diamonds", "clubs", "spades"}; for(i=0; i<size; i++) { if(i%13 == 0 || i%13 == 10 || i%13 == 11 || i%13 == 12) printf("%s ", facecheck(i%13) ); else printf("%d ", i%13+1); printf("of %s \n", suits[i/13]); }; **}**
you didn't close draw
function. you're missing }
@ end:
void draw(int deck[size]) { int i; for(i = 0; < 5; i++) { cards; putchar('\n'); } } //add me please :(
as stated on comments, ide have caught before compiling.
i recommend indent code can better match opening/closing braces.
your code suffers additional errors, highly recommend read tutorial , review code.
Comments
Post a Comment