just started learning some cpp and got this stuff going:
#include <string>
using std::string;
class Vigenere{
public:
Vigenere(string key, string alphabet = "abcdefghijklmnopqrstuvwxyz");
string encode(string message, string key = _key, string alphabet = _alphabet);
string decode(string message, string key = _key, string alphabet = _alphabet);
private:
string _alphabet;
string _key;
};
while trying to compile it says "10 [Error] invalid use of non-static data member 'Vigenere::_key'";
line 10 is string Key;
So, is there a way to make it so i can use those variables for each object separately while using them as default arguments?