Hi,
void eloop(char c, string elr)
This function is void, and none of the parameters are passed by reference, so calling the function effectively does nothing.
So change it to this:
void eloop(const char c, string& elr)
That way
elr
will have it's value changed.
But more important than that, there are some major changes to be made:
Don't use
goto
- use loops instead. goto leads to really bad code, unless you are an expert (There are advanced reason where one might need to use it)
The encry cpp file could be greatly improved using a different data container try
std::map<char, std::string>
You can use it to "lookup" a char and get it to return it's matching string.
http://www.cplusplus.com/reference/map/map/map/
http://www.cplusplus.com/reference/map/map/operator[]/
http://www.cplusplus.com/reference/map/map/at/
You can use the encryption map to make a decyrption map.
Also, make you life easier by not doing this:
if(d=="y" || d=="Y" || d== "Yes" || d=="yes" ||d=="YES" ||d=="YEs" ||d=="YEAH")
The problem is that it is not worth it to try and cater for every combination of spelling and upper / lower case.
Instead make use of the toupper function which converts a single char to uppercase.
http://www.cplusplus.com/reference/cctype/toupper/?kw=toupper
It's a bit odd to ask whether one wants to write to a file when the other option is to end the program.
In future, if you have errors, post them here verbatim.
Good Luck !!