Hello.
I'm writing a program for encryption and decryption. I'm given a csv file which contains the key I need to encrypt and decrypt with. The file looks like that:
a,r
b,c
and so on. It means that a should be replaced with r,b replaces with c and etc.
I'm given the function encrypt(string text, fstream& dictionary)
I'm having a trouble separating the line a,r for example to text and key.
I'm having a trouble separating the line a,r for example to text and key.
Assuming you have an ifstream or fstream opened for input, you could read from it like this. What you do with the values read from the file is up to you, this just prints them to the console.