开发者

expected ‘)’ before ‘;’ token

Having a wierd day with C. I get a compile error expected ‘)’ before ‘;’ token for the line else if(inputIntWithinRange(r, 1, MAX_MINES_GRID) == FALSE) validated = FALSE;

If I comment that line out I no longer get the error. As far as I can tell my syntax is fine, does anybody have an inkling as to what is going on here??

Thanks!

do
   {
      validated = TRUE;

      getUserInput(input, MAX_MINES_LENGTH + EXTRA_SPACES);
      sscanf(input, "%d", &r);

      if(inputWithinAllowedLength(input) == FALSE) validated = FALSE;
      else if(inputDigitsOnly(input) == FALSE) validated = FALSE;
      else if(inputIntWithinRange(r, 1, MAX_MINES_GRID) == FALSE) validated = FALSE;
   }
   while(validated == FALSE);
开发者_C百科


I know i'm not answering the question, but I would change code to be:

validated = inputWithinAllowedLength(input) 
    && inputDigitsOnly(input)
    && inputIntWithRange(r, 1, MAX_MINDES_GRID);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜