Is it possible in C++ to declare a vector of characters as a private variable in a class header file? If so, why isn't it working for me?
When I declare, like this:
class myClass
{
public:
//public functions
private:
vector<char> myVector;
}
The program compiles, but when I set up the default constuctor in the .cpp file that matches up with this .h class header, like this:
myClass::myClass()
{
myVector(‘a’,‘b’,‘c’);
}
…the program does not compile. What’s the deal?
Using Fluther
or