I'm trying to write a C++ program that uses some compound structs and vectors, and I'm getting a compile time error: multiple types in one declaration.
Here's the form my code's in:
#include <vector>
using namespace std;
struct Struct2 {
int value1;
int value2;
}; // end Struct2
struct Struct1 {
int value;
vector<Struct2> vec;
}; // end Struct1
class MyClass {
public:
// constructor and various methods
private:
vector<Struct1> classVec;
}; // end MyClass
That error points to the line where "classVec" is declared. I've tried some things like adding empty constructors to the structs, but that didn't change anything. Any pointers would be appreciated.
Thanks!