0

What is the easiest fastest way to see what's in these three arrays. I just want to see what 's in there to make sure my function is working correctly.

#include <iostream>
#include <iomanip>
#include <fstream>

using namespace std;

const int MAX_ITEMS = 50;
int readData(string studentNames [], int wins [], int losses []);
ifstream infile;


int main()
{

string studentNames[MAX_ITEMS];
int wins[MAX_ITEMS]; 
int losses[MAX_ITEMS];


return 0;	
}

int readData(string studentNames [], int wins [], int losses []) //this function takes data from text file and puts it into an array
{
	infile.open("players.txt");
	
	int count=0;
	while (infile.peek() !=EOF)
	{
		infile >> studentNames[count] >> wins[count] >> losses[count];
		count++;
	}
	infile.close();
	
	return count;
}
3
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by mazzica1
1

just print them

infile >> studentNames[count] >> wins[count] >> losses[count];
cout<< studentNames[count] << " " << wins[count]<< " " << losses[count]<<endl;
count++;
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.