You can just pass in a different named parameter. This is assuming that encoded
is a private string member of your bnf
class
bnf::bnf(string en)
{
encoded = en;
}
In your other functions, you still don't need to write this
if you don't want to:
void bnf::printCode(){
cout << encoded << endl;
}
Assuming your class looks like this:
class bnf{
public:
bnf(string en};
void printCode();
//<some other functions>
private:
string encoded;
}