-
Thanks this has helped a lot. Maybe I can get it now. I'll give this theory a try and see what I get. I'm sure i'll be back with more questions.
I only have one more week of this 5 week class, and have realized I have just skimmed the surface of "C" and do not know it well enough too save my bacon.
Thanks everyone for help.
Tamara
-
Well I've tried every suggesting and still cannot get the character check to work. My last attempt had an endless loop of two re-enters across the screen. The program works great until I try to add this character check. Then nothing works right. Attached is my latest version without the character check.
I have learned a lot even though my program still does not work. I am very thankful for all of the help. Thanks everyone.
Tamara
-
After trial and error and all the responses I finally got the program to run it just needed this
Code:
iResponse = scanf("%f", &fSubtotal );
while (fSubtotal < fCheck || iResponse != 1){
fflush(stdin);
printf("\n\tPlease Re-enter your Subtotal: $");
iResponse = scanf("%f", &fSubtotal );
}//end while loop
The reason it kept loopping is I needed to flush the variable. How wierd but it works.
Thanks again
Attached is the final program. That works great.
-
Well its good to hear you got it running. fflush(stdin) is not meant to be a good way to flush the input buffer tho. Heres an explanation of why. And Heres an example of a better method.
-
Thanks Mike
Since yesterday I have learned more about "C" in one 24-hour period than the whole 4 weeks of class
Tamara