View Full Version : C program: you want me to do what?
Math Is Hard
May29-04, 09:58 PM
Hi all,
I am working on one of my first assignments for my C class. My teacher gave the following instructions:
Write a printf statement that outputs the phrase "To be continued" and then advances to the next page.
I am completely confused by what he means by "advance to the next page"? Is that like going to a new line? I thought I would ask y'all first before I email him in case it's something completely obvious.
thanks!!
Hi all,
I am working on one of my first assignments for my C class. My teacher gave the following instructions:
Write a printf statement that outputs the phrase "To be continued" and then advances to the next page.
I am completely confused by what he means by "advance to the next page"? Is that like going to a new line? I thought I would ask y'all first before I email him in case it's something completely obvious.
thanks!!Looks like he wants a page break. You probably know that '\n' is the new line character, and will advance to the next line. See if you can find a bunch of special characters, and find the one that advances to the next line.
Hrm... maybe he meant "advances to the next line"?
Math Is Hard
May29-04, 10:44 PM
Next line is all I can figure - and I can't find anything about "next page" anywhere in my book. However, there's plenty of instruction in the first chapters about going to the next line.
Thanks for your help.
\f - form feed
\r - carriage return
\v - vertical tab
If you look in the index of your book, you should find these. Or look up "escape sequences." Anyways, the 3 above are the ones I would think most likely to produce a new page... experiment and let us know what does what.
Who knows,
He may want you to wait for an input after the "to be continued", and then clear the page by having enough \n's.
Pattielli
May30-04, 05:16 AM
I agreed completely !
3 months later, new school year begins in schools in America. Are you making some preparations for it ?
______________________________________________
My signature:
>>>> Some places i have learnt are full of injuries, tears, and blood, if that is what people call a little actual love for their lovers, they should never try to bring their lovers to such places <<<<
Please don't quote this post of mine because my signature will go with your quote...<SAL>(smile a lot)
Math Is Hard
Jun1-04, 06:26 PM
aha! here's what my prof sez:
This is a case of "old" terminology corrupting the modern generation. In my day, printers used continuous feed paper where you had to separate each sheet along the perforation. To tell the printer to go to the next sheet, or "form", you did a form feed command to the printer. The terminology is still used on occation today to mean "next page". The printf escape sequence is \f for "Form feed" which really means "page break" or "advance to next page".
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.