locked
syntax error: identifier grade RRS feed

  • Question

  • I am newbee to C++ and encountering some problems.

    My compiling is as follows:

    #include <stdio.h>
    int main(void)
    {
     int grade;
      scanf_s( "%d", &grade);
     if grade >= 60
      printf( "passed\n");

     return 0;

    }  /* The end */

    When build, it says: error C2061: syntax error : identifier 'grade'

    Who can give me a hand?


    • Edited by abtring Monday, November 2, 2015 7:17 AM
    Monday, November 2, 2015 7:17 AM

Answers

  • if grade >= 60
    --->
    if (grade >= 60)

    Visual C++ enthusiast, like network programming and driver development. At present is being engaged in the WinCE/Windows Mobile platform embedded development.

    • Proposed as answer by chchlll Monday, November 2, 2015 9:41 AM
    • Marked as answer by abtring Wednesday, November 4, 2015 9:01 AM
    Monday, November 2, 2015 7:20 AM

All replies

  • if grade >= 60
    --->
    if (grade >= 60)

    Visual C++ enthusiast, like network programming and driver development. At present is being engaged in the WinCE/Windows Mobile platform embedded development.

    • Proposed as answer by chchlll Monday, November 2, 2015 9:41 AM
    • Marked as answer by abtring Wednesday, November 4, 2015 9:01 AM
    Monday, November 2, 2015 7:20 AM
  • Thank you very much. My mistake, and get the codes working now.
    Monday, November 2, 2015 7:53 AM