error #.. ISO C++ forbids declaration of 'vector' with no type.
why this error at a small code that?
it's a file.h
#include...
class Vetor
{
private:
vector<int> vetor;
public:
void setVetor( vector<int> vetor );
vector<int> getVetor( void );
};
Can't define vector into a class?
Works fine here:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
#include <vector>
#include <iostream>
class Vector
{
public:
void push_back(int);
private:
std::vector<int> vec;
};
int main()
{
Vector myV;
return 0;
}
|
Last edited on