Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

C program: you want me to do what?

  1. May 29, 2004 #1

    Math Is Hard

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    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!!
     
  2. jcsd
  3. May 29, 2004 #2

    AKG

    User Avatar
    Science Advisor
    Homework Helper

    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.
     
  4. May 29, 2004 #3

    enigma

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Hrm... maybe he meant "advances to the next line"?
     
  5. May 29, 2004 #4

    Math Is Hard

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    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.
     
  6. May 29, 2004 #5

    AKG

    User Avatar
    Science Advisor
    Homework Helper

    \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.
     
  7. May 30, 2004 #6

    enigma

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    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.
     
  8. May 30, 2004 #7
    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)
     
  9. Jun 1, 2004 #8

    Math Is Hard

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    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".
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: C program: you want me to do what?
  1. What do you think (Replies: 4)

Loading...