-4

我不断收到以前从未见过的奇怪语法错误,我不确定它有什么问题。我可以得到一些额外的眼睛来帮助我找出问题所在吗?

错误内容为:错误:输入末尾的预期声明或语句粗线是它突出显示的错误。

void draw(int deck[SIZE])
{
     int i; 

     for(i = 0; i < 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]);
    };

**}**
4

3 回答 3

4

You didn't close draw function. You're missing a } at the end:

void draw(int deck[SIZE])
{
     int i; 
     for(i = 0; i < 5; i++)
     {
           cards;
           putchar('\n');
     }
} //ADD ME PLEASE :(

As stated on the comments, a good IDE could have caught this before compiling.

I also recommend you to indent your code so you can better match opening/closing braces.

Your code suffers from additional errors, I highly recommend you to read a tutorial and to review your code.

于 2013-04-05T22:27:50.270 回答
1

'牌;' 看起来很可疑,因为它是函数的名称

于 2013-04-05T22:26:52.037 回答
0
        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]);
        }; //no need of semi-colon after curly brace
    }
 } //missing curly brace
于 2013-04-05T22:32:12.730 回答