Thread: Input from file no white space characters

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    System-7
    Join Date
    Nov 2005
    Posts
    65

    Input from file no white space characters

    I'm reading data in from a file and putting it into a string then appending it to another file. The problem with this is that all the data is put onto one line with no whitespace characters put into outputted file. I assume this is due to the string. Is there any way to be able to output whitespace characters?

    Here is part of the code:
    Code:
    CInput.open(FileName.c_str(), ios::in);
    		
    while (!CInput.eof())	//Read until end of file
    {
    	CInput >> FileLine;
    	FileData.append(FileLine);
    }
    Thanks,

    ...Dan
    Last edited by Dan17; 05-08-2006 at 06:28 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Newbie homework help
    By fossage in forum C Programming
    Replies: 3
    Last Post: 04-30-2009, 04:27 PM
  2. Data Structure Eror
    By prominababy in forum C Programming
    Replies: 3
    Last Post: 01-06-2009, 09:35 AM
  3. Inventory records
    By jsbeckton in forum C Programming
    Replies: 23
    Last Post: 06-28-2007, 04:14 AM
  4. Trouble with a lab
    By michael- in forum C Programming
    Replies: 18
    Last Post: 12-06-2005, 11:28 PM