Thread: need help with a for loop

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    12
    change your for statement to read

    for(count=0;count<days;count++)
    beacuse I think the ++ before count is causing a problem

    and when you want to clear the keyboard buffer, if I understand your code correctly, you can write another fuction that uses getchar

    i.e
    Code:
    void clear(){
     while(getchar()!='\n');
    }
    or you can use fflush and put it after your scanf in your for loop.
    Also if you want to add all the temps together you can do that in your for loop for example you could do this after your scanf

    temp+=temp

    and it should work other than that your code looks great

    Hope that helps you and good luck
    Last edited by jccharl; 03-10-2004 at 11:16 PM.

Popular pages Recent additions subscribe to a feed