Hey all,
I devised a program to read a file called student.txt that has in the firs line # of students and number of socres then has the scores
student.txt:
Code:
3 3
95 100 95
90 85 95
100 100 80
here is the program
Code:
#include <iostream>    
#include <conio.h>     
#include <iostream>
#include <fstream>
#include <cassert>
#include <vector>
using namespace std;

class FirstRow
	{
		int StudentCount;
       	int ScoreCount[5];
};
class Student
          {	
	          char name[20];
	          int mark[5];
};

int main(int argc, char *argv[]) 

{       int lsStudentCount;
        int lsScoreCount[5];
        int *p;
        char lsstudent[5][20];
        int count = 0;
        int Row =1;

        Student sobj;
        FirstRow fstobj;

		ifstream in("student.txt", ios::in);
        if(in.is_open()) 
			{
				in.read((char*) &fstobj, sizeof(fstobj));
				lsStudentCount = fstobj.StudentCount;
				lsScoreCount[0] = fstobj.ScoreCount[0];
				lsScoreCount[1] = fstobj.ScoreCount[1];
				lsScoreCount[2] = fstobj.ScoreCount[2];
				lsScoreCount[3] = fstobj.ScoreCount[3];
				lsScoreCount[4] = fstobj.ScoreCount[4];
           }

		p = new(nothrow) int[lsStudentCount+1][6];
		in.close();
		ifstream inData("student.txt", ios::in);
		if(in.is_open()) 
		{
			while(!in.eof()) 
				{
					if(Row == 1)
					{
						in.read((char*) &fstobj, sizeof(fstobj));
						Row = 2;
					}
					else
  					{
						in.read((char*) &sobj, sizeof(sobj));
					if(!in.eof()) 
					{
						strcpy (lsstudent[count],sobj.name);
						p[count][0] = sobj.[0];
						p[count][1] = sobj.[1];
						p[count][2] = sobj.[2];
						p[count][3] = sobj.[3];
						p[count][4] = sobj.[4];
					}
					count++;
				}
		}
	}
	in.close();
	int studentsum = 0;
	int studentpercentage;
	int countx = 0;
	int county = 0;

	while(countx < lsStudentCount)
     { 
		while(county <5)
            {
				studentsum = studentsum + p[countx][county];
             	county++;
	   		}
       	studentpercentage = (studentsum * 100)/500;
       	p[countx][5] = studentpercentage;
      	studentsum = 0;
       	studentpercentage = 0;
       	county = 0;
       	countx++;
     }
	int countx = 0;
	int county = 0;
	int scoresum = 0;
	int scoreaverage;
	while(county < 5)
     { 
		while(countx < lsStudentCount)
            { 
				scoresum = scoresum + p[countx][county];
              	countx++;
           	}
		scoreaverage = 	scoresum / lsScoreCount[county];
		p[lsStudentCount][county] = scoreaverage;
		scoresum = 0;
		scoreaverage = 0;
		countx = 0;
		county++;
     }


	int x = 0;
	cout << "Student Results:";
	while(x< lsStudentCount)
		{ 
			cout << p[x][5] << ": ";
       		cout << lsstudent[x] << "\n";
      		x++;
		 }

	int x = 0;
	cout << "Score Results:";
	while(x < 5)
		{ 
			cout << "1st score: ";
       		cout << p[lsStudentCount][x] << ": "<<"\n";
       		x++;
		}
}
will not compile can anyone help