I've designed a program that can encrypt 26 English letters.
Here's how I'm handling the input. I'm reading it from a text file and stores it in a string.
ifstream L;
string str1;
char ch;
L.open("ToBeCoded.txt");
while(iL.get(ch))
str1.push_back(ch);
However, it's inefficient, if I want to read a different file, I have to change the name in codes to make it work. So is there any dynamic way to do so? Like drag the file or type the address of the file during run time?
By the way, do you have a better way to read txt to string? This one 'seems' slow.