开发者

expected ‘)’ before ‘;’ token

开发者 https://www.devze.com 2023-02-22 03:31 出处:网络
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;

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

精彩评论

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