By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,616 Members | 2,026 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,616 IT Pros & Developers. It's quick & easy.

Continue statement not within loop?

P: 2
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

Expand|Select|Wrap|Line Numbers
  1. 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);
  2.                              {
  3.                                    reply='n';
  4.                                    if (stricmp(idNumber,idCheck)==0)
  5.                                       {
  6.                                            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,
  7.                                            familyName,firstName,bookCode,dateIn.month,dateIn.day,dateIn.year);
  8.                                            if (dateToday.year>dateOut.year){
  9.                                               printf("THE BOOK IS OVERDUE.");}
  10.                                            else if ((dateToday.year>=dateOut.year) && (dateToday.month>dateOut.month)){
  11.                                                 printf("THE BOOK IS OVERDUE.");}
  12.                                            else if (((dateToday.year>=dateOut.year) && (dateToday.month>=dateOut.month)) && (dateToday.day>dateOut.day)){
  13.                                                 printf("THE BOOK IS OVERDUE.");}
  14.                                            scanf("%c", reply);
  15.                                       }
  16.                                    if ((reply=='y') || reply=='Y')
  17.                                               continue;
  18.                                    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);
  19.                              }
  20.  
Mar 4 '11 #1

✓ answered by jjdot

remove the semi-colon at the end of first line
Expand|Select|Wrap|Line Numbers
  1. while(fscanf(records,...

Share this Question
Share on Google+
3 Replies


Banfa
Expert Mod 5K+
P: 8,916
You have a ; at the end of the while line 1.
Mar 4 '11 #2

P: 11
remove the semi-colon at the end of first line
Expand|Select|Wrap|Line Numbers
  1. while(fscanf(records,...
Mar 4 '11 #3

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

Post your reply

Sign in to post your reply or Sign up for a free account.