Results 1 to 5 of 5

Thread: Any suggestions on how I should read in this file?.:Resolved:.

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member voidflux's Avatar
    Join Date
    Jun 2003
    Location
    Brockway, PA
    Posts
    290

    Question Any suggestions on how I should read in this file?.:Resolved:.

    Hello everyone, I have a file set up like this:

    100 93
    43 30
    80 70
    ... ...
    these grades are seperated by a tab character, the first column is lab 1, the second column is lab 2, I want to seperate these 2 columns and manipulate them seperately, like, I will have to find the average of them, the mode of them, and the min and max of each lab, any idea's? I was trying to seperate them into 2 different arrays, but thats not working too well!
    Code:
    int array1[500];
    	int array2[500];
    	int one;
    	int two;
    	char ch;
    	char newline;
    	int i =0; 
    
    	while(!inFile.eof())
    	{
    		inFile >>one>>ch>>two>>newline;
    		array1[i] = one;
    		array2[i] = two;
    		i++;
    
    	}
    thanks!
    Last edited by voidflux; Dec 11th, 2003 at 12:41 AM.
    C¤ry Sanchez
    Computer Science/Engineering
    @ Penn State
    IBM.zSeries Intern
    Mandriva 2007

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width