Have a .txt with info listed as:
Name
Exam:
98
100
99
Quiz:
98
87
89
90
98
Project:
76
89
with 15 dif names. I need to put this data into a 2d array with students as the rows, and grades as columns and display it on screen. New to this still so bare with me.
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <cmath>
using namespace std;
int main()
{
ifstream inputFile;
inputFile.open("GradeSpring06.txt");
if (!inputFile)
{
cout << "Error opening file!" << endl;
exit( 1 );
}
int data[15][10];
for (int indexrow=0; indexrow<15; indexrow++)
{
for (int indexcol=0; indexcol<10;indexcol++)
{
inputFile >> data[15][10];
}
}
cout << data[15][10];
#ifdef WIN32
system("pause");
#endif
return 0;
}
thats what i have so far. i know its not much but far as i could go.