Thread: Reading from text file

  1. #1
    T-Mac wiz23's Avatar
    Join Date
    Apr 2005
    Location
    Houston
    Posts
    48

    Writing to text file

    When OutFile to a text file, why does it display in a straight line even though I have set << endl; at the end?
    Last edited by wiz23; 05-02-2005 at 04:56 AM.
    You can't guard me 1 on 1!

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    More code.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    No idea.
    Post a program which does this (a test program if your main program is large), and state your operating system and compiler.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #4
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    Why is your title "reading form text file" when the problem is about writing to it?
    Anyway, what program do you use to view it? That might be the problem too. I've noticed this effect on other text files, most likely caused by the \n \r stupidity...
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  5. #5
    T-Mac wiz23's Avatar
    Join Date
    Apr 2005
    Location
    Houston
    Posts
    48
    I use Notepad to see the text file.
    You can't guard me 1 on 1!

  6. #6
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    Try wordpad?
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  7. #7
    T-Mac wiz23's Avatar
    Join Date
    Apr 2005
    Location
    Houston
    Posts
    48
    Oh OK, thanx. I can see them in a better layout.
    You can't guard me 1 on 1!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Formatting the contents of a text file
    By dagorsul in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2008, 12:36 PM
  2. Inventory records
    By jsbeckton in forum C Programming
    Replies: 23
    Last Post: 06-28-2007, 04:14 AM
  3. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  4. Reading Character at a time from a text file
    By Giania in forum C Programming
    Replies: 8
    Last Post: 02-25-2006, 03:17 PM
  5. A bunch of Linker Errors...
    By Junior89 in forum Windows Programming
    Replies: 4
    Last Post: 01-06-2006, 02:59 PM