Thread: Help with my notepad.

  1. #16
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    That doesn't put each word on a new line. It does put each line on a new line. Did you try it? I think you tried if before you switched to getline.

    There are two parts to this. Input and output.

    Using getline for input means that the entire line that you type will be read into text.

    Using file << text << endl for output means that the entire string stored in text is output the file on its own line.

    Combining the two means that the entire line you type into the console is added on its own line in the file. That's what you want.

  2. #17
    Registered User
    Join Date
    Jul 2007
    Posts
    16
    Yes, thanks alot for your time and help! It works fine now.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Annoying Escape Character Squares in Notepad
    By firetheGlazer in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 07-18-2008, 02:17 AM
  2. Strange problem with notepad
    By IceDane in forum C Programming
    Replies: 15
    Last Post: 09-10-2007, 09:46 AM
  3. text files & notepad problem
    By bigtamscot in forum C Programming
    Replies: 2
    Last Post: 05-01-2003, 04:41 PM
  4. notepad
    By denny in forum C Programming
    Replies: 1
    Last Post: 04-15-2002, 11:32 AM