Thread: comma seperated lists

  1. #1
    Registered User
    Join Date
    May 2004
    Posts
    36

    comma seperated lists

    Hi guys

    In addition to my other query I have just found that I need to create comma seperated lists for a PSI file.

    currently I have the following code

    Code:
    	float x, y, z;
    
    	if (finput.is_open() && foutput.is_open()){
    		
    
    
    		while (!finput.eof()){
    			
    			finput >> x >> y >> z;
    			foutput << x  << " " << y << " " << z << " " << 0 << " " << index << endl ;
    			index++;
    			
    		}
    However as you can see this is just space deliminated.

    How do I create comma seperated files?

    Cheers

  2. #2
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    replace " " with ','

  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
    > while (!finput.eof()){
    This is wrong - read the FAQ
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help creating lists of pointers
    By The_Kingpin in forum C Programming
    Replies: 2
    Last Post: 12-11-2004, 08:10 PM
  2. Question about Linked lists of lists
    By hear_no_evil in forum C Programming
    Replies: 2
    Last Post: 11-08-2004, 02:49 AM
  3. Linked Lists 101
    By The Brain in forum C++ Programming
    Replies: 5
    Last Post: 07-24-2004, 04:32 PM
  4. Map file formats and linked lists
    By Spitball in forum Game Programming
    Replies: 2
    Last Post: 03-04-2004, 11:32 PM
  5. need help w/ linked lists
    By MKashlev in forum C++ Programming
    Replies: 11
    Last Post: 08-05-2002, 08:57 PM