Continue statement not within loop?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Paulo Santos
    New Member
    • Mar 2011
    • 2

    Continue statement not within loop?

    First of all, it's my first time here.
    Also, i'm working on a simple rent management program for a school project. I've fixed most of the errors but i'm lost on what could be wrong here:

    error: continue statement not within a loop

    Code:
    while(fscanf(records,"%s %s %s %s %d %d %d %d %d %d", idNumber, familyName, firstName, bookCode, &dateIn.month, &dateIn.day, &dateIn.year, &dateOut.month, &dateOut.day, &dateOut.year)!=EOF);
                                 {
                                       reply='n';
                                       if (stricmp(idNumber,idCheck)==0)
                                          {
                                               printf("Will you check in this?: ID#: %s\nName: %s, %s\nBook Code: %s borrowed on %d/%d/%d Due: %d/%d/%d(y/n)?\n",idNumber,
                                               familyName,firstName,bookCode,dateIn.month,dateIn.day,dateIn.year);
                                               if (dateToday.year>dateOut.year){
                                                  printf("THE BOOK IS OVERDUE.");}
                                               else if ((dateToday.year>=dateOut.year) && (dateToday.month>dateOut.month)){
                                                    printf("THE BOOK IS OVERDUE.");}
                                               else if (((dateToday.year>=dateOut.year) && (dateToday.month>=dateOut.month)) && (dateToday.day>dateOut.day)){
                                                    printf("THE BOOK IS OVERDUE.");}
                                               scanf("%c", reply);
                                          }
                                       if ((reply=='y') || reply=='Y')
                                                  continue;
                                       fprintf(temp,"%s %s %s %s %d %d %d %d %d %d", idNumber, familyName, firstName, bookCode, dateIn.month, dateIn.day, dateIn.year, dateOut.month, dateOut.day, dateOut.year);
                                 }
    Last edited by Paulo Santos; Mar 4 '11, 10:48 AM. Reason: missed the thing about including the errors
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    You have a ; at the end of the while line 1.

    Comment

    • jjdot
      New Member
      • Feb 2011
      • 11

      #3
      remove the semi-colon at the end of first line
      Code:
      while(fscanf(records,...

      Comment

      • Paulo Santos
        New Member
        • Mar 2011
        • 2

        #4
        Really? Wow, i didn't notice that. I'm a bit new to this though.

        Comment

        Working...