I am trying to infile my data file into two seperate arrays which are seperated by a white space in my file.
But I keep getting -86******* something number where my file is suppose to be any help will be very helpful. My first array which will read the student id is a one dimensional array and the second arry is a 2 dimensional arry which will read in the students answers to a true false test and the second col will be the total number correct for each true false question. Yeah and the answer key is suppose to be the last line in the 2 D array which is the first line in my data file.
#include<iostream>
#include <fstream>
#include "string"
using namespace std;
int main()
{
const int maxstudents=50;
const int maxcols=3;
char quiz[maxstudents+1][maxcols];
int studentid[maxstudents];
ifstream infile;
string inputfile;
cout<<"Input filename"<<endl;
cin>> inputfile;
infile.open(inputfile.c_str());
for (int c = 0; c<maxstudents; c++)
infile>>quiz[maxstudents][c];
for (int k=0; k<maxstudents; k++)
infile>>studentid[k];
for (int j=0; j<maxstudents; j++)
cout<<"studentid"<<j<<"\t"<<studentid[j]<<endl;
for (int r=0; r<10; r++)
cout<<quiz[maxstudents][r]<<"\t";
return 0;
}