I'm new in C++ programming and for some time, I've been trying to resolve a problem with a vector<vector<int> >
.
This is the header file
#ifndef ASSIGNMENT_H_
#define ASSIGNMENT_H_
#include <iostream>
#include <vector>
#include <string>
using std::string;
using std::vector;
using namespace std;
class Mood{
public:
string lecture;
vector<Block> blocks;
Mood(vector<vector<int> > &m, string lecture){
this->lecture=lecture;
for(auto r: m){
blocks.push_back(Block(r));
}
}
};
#endif
Block is another simple class with just 2 int written in the same file (but I think it not important for my problem).
The problem is in the main written in another file:
#include <iostream>
#include <vector>
#include <string>
#include "assignment.h"
using std::vector;
using std::string;
using namespace std;
int main(){
Mood r= Mood({{1,2}},"Hello");
}
The error is very general: expected expression