#include <vector>
#include <iostream>
#include <iomanip>
using namespace std;
typedef vector<double>row;
typedef vector<row>Matrix;
Matrix grade;
void read_matrix(Matrix&grade,vector<string>&names);
void display_matrix(const Matrix&grades,const vector<string>&names);
void read_matrix(Matrix&grade,vector<string>&names)
{ int grades;
cout << "Reading data into a Matrix " << endl;
cin >>grades;
if(grades== 0)
{
cout << "Making vector empty." << endl;
grade.resize(0);
}
else {
grade.resize(grades);
for (int i=0;i<grades;i++)
{grade.at(i).resize(5);}
}
int _student;
cout << "Enter student name"<<endl;
cin>>_student;
names.resize(_student);
for (int i= 0; i<names.size(); i++)
{cin >> names.at(i);}
}
void display_matrix(const Matrix&grade,const vector<string>&names){
cout<<" ";
for ( int j=0;j<names.size();j++)
{cout<< setw(5)<<setprecision(2)<<names.at(j)<<" ";
}
for (int k=0;k<grade.size();k++)
{ cout<< setw(5)<<setprecision(2)<<grade.at(k)<<" "<<
cout<<endl;}
}
Here I need to write a two dimensional arrays one to read in the grades,and another to read in the names of students,and then print them like : john 9.5
Sammy 10
and so on,but my compiler gives me an error like no match for "<< operator" is there something wrong with my code?