I want to do two-dimensional array..
STUDENT1 take 001, 003, 005,006
STUDENT2 take 005, 007, 009, 001
001 002 003 004
like this 001 0 2 1 ....
002
003
004
and I do a programming like below, but how to fill inside the { }?
// --------------------------------------------------------------
// Read a file of Stu83.txt
// Count number of ExamID in following ranges
// --------------------------------------------------------------
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
#include <cassert>
#include <stdlib.h>
using namespace std;
// =========================
// Global Declarations
// =========================
const int NUM_EXAMID = 140
int var_name[140]; // C++ Array of type int with maximum size = 10000.
int array_matrix[140][140]; //Matrix of 3 * 3 type using c++ array of int data type
// =========================
// Main Function
// =========================
int main()
{
ifstream stream1 ("STA83STU.txt");
string filename;
double examid[NUM_EXAMID]; // declares 10 scores
// Prompt user for the file name
cout << "Enter input file name containing scores: ";
getline(cin, filename);
infile.open(filename.c_str());
// Validate that the input file opened successfully
assert(infile);
char lgrade;
int Acount = 0, Bcount = 0, Ccount = 0, Dcount = 0, Fcount = 0, invalidcount = 0;
for ( int i = 0; i < NUM_EXAMID; ++i)
{
infile >> examid[i];
switch (ltotal)
{
}
cout << examid[i] << " => " << ltotal << endl;
}
// Display counter statistics
infile.close();
// TODO: Write a function printArray that prints the entire array
// of scores. Pass the array in as a parameter.
cout << "Enter input file name containing examid: ";
getline(cin, filename);
infile.open(filename.c_str());
// Validate that the input file opened successfully
assert(infile);
printScores(scores, NUM_EXAMID);
return 0;
}
void printExamID(const double s[], int len)
{
}