I need help removing the comma and some help with managing a "word"

Let's suppose that this is an another .txt file;
 
max,6,13.6,84.9,10.1,47.4


And this is what I write for the file input.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <iostream>
#include <fstream>
using namespace std;
int main ()
{
	char name[200]={'\0'};
	int num[100]={0};
	float arr1[100]={0};
	float arr2[100]={0};;
	float arr3[100]={0};
	float arr4[100]={0};
	int count=0;
	
	ifstream file;
	file.open("test.txt");
	
	while(!(file.eof()))
	{
		file >> name[count];
		file >> arr1[count];
		file >> arr2[count];
		file >> arr3[count];
		file >> arr4[count];
		
		count++;
	}
}


I know in the name array only the alphabet "M" will go in the name-array. How can I input the entire name or ignore it? And I cannot use Multi-Dimensional Arrays or string.

And after the data is read, this should be the output on the command prompt;
 
max 6 13.6 84.9 10.1 47.4

or
 
6 13.6 84.9 10.1 47.4


How can I do this?
Last edited on
Last edited on
Topic archived. No new replies allowed.