how to count line by line VC++

how to count line by line:
the output look like this:
there are 6 numbers in data set 1 :
there are 4 numbers in data set 2 :
my problem is, when i run the output all going to be set 1 for every set of data..


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  {
	int i;
	int count =0;

	infile >> n;

	for (i=0; i < n; i++)

	{
		infile >> x[i];
	}
     
	count ++;
	
            cout << "There are " << n << " numbers in data set " << count << ":" <<  endl;
            count=0;
         
        }
         
}
I'm a beginner here too, so a gain of salt might be needed.
You don't have your second set defined. It sets one array, not two.
Topic archived. No new replies allowed.