#include <iostream>
#include <vector>
usingnamespace std;
class Board{
vector<char> board (3);
public: Board()
{
}
public: void modboard(int x, int y, char xo)
{
}
};
int main()
{
vector<int> valuesd(5);
return 0;
}
This code gives me the error: "expected ';' before '(' token" in line 9 (right after the class definition). However, if I do not specify the size of the vector, I do not get an error.
at first the default constroctor for the vector is called then inside the body of the constructor of the class Board a temporal vector is created and the copy assignment operator is called to assign this temporal vector to the vector board.
In my example instead of calling at first the default constructor for the vector the required constructor is called at once.