comma seperated lists

This is a discussion on comma seperated lists within the C++ Programming forums, part of the General Programming Boards category; Hi guys In addition to my other query I have just found that I need to create 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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,340
    > 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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

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, 07:10 PM
  2. Question about Linked lists of lists
    By hear_no_evil in forum C Programming
    Replies: 2
    Last Post: 11-08-2004, 01: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, 10:32 PM
  5. need help w/ linked lists
    By MKashlev in forum C++ Programming
    Replies: 11
    Last Post: 08-05-2002, 08:57 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21