Hello I am making an encryption program and It is working.The only problem I have is that my program only stores the last line of of the text file in the string.I want it to store all the lines in the string(the whole paragraph in the string).This is proved because,When I try to print the message to encrypt it only prints the last line.
Can someone tell me what I've done wrong.The relevant section of code is below.
getline() can accept a deliminator parameter. This means that it will keep extracting text until it hits a certain character. By default, the character is \n (new line) but you can set it yourself.
Like this:
getline(flnp, themessage, '@'); //will keep going until it hits @. be sure to use single quotes ' '
Just put your character of choice where @ is, and then put it at the end of your file.