Having trouble using vector as a member of a class? Here's the code I'm using and it gives a "syntax error 'constant'" error on build. Possibly #include order problem or what i'm #including or definition of vector or that's it's a member of the class? I can't figure this out.
Here's the code:
//#pragma warning(disable:4786)
#include <iostream>
#include <vector>
#include <iterator>
#include <string>
#include <numeric>
#include <functional>
#if _MSC_VER > 1020
using namespace std;
#endif
class myclass {
public:
//int i;
vector <int> myvector(1);
};
int main (void) {
my class myobject;
return 0;
}
Here's the code:
//#pragma warning(disable:4786)
#include <iostream>
#include <vector>
#include <iterator>
#include <string>
#include <numeric>
#include <functional>
#if _MSC_VER > 1020
using namespace std;
#endif
class myclass {
public:
//int i;
vector <int> myvector(1);
};
int main (void) {
my class myobject;
return 0;
}