line 49: Useless line because the loop on line 47 stops when EOF is reached.
line 52 is where you would build a string.
Something like this:
#include <iostream>
#include <fstream>
#include <iomanip>
#include <vector>
#include <string>
void Form1_Load(System::Object^ sender, System::EventArgs^ e) {
vector<string> Lines; // make this a member of the Form1 class so that it can be used in other functions
/*Decryption --- When program loads*/
string line;
char ch,mod;
char key = 97;
const char *name = "Encrypted.txt";
ifstream fin(name, ios::binary); // Reading file
if(!fin) //open the encrypted file in a binary mode
{
//MessageBox::Show("Encrypted.txt did not open"); //If file does not exist
} //or any kind of error
while(fin.get(ch))
{ // opens the Encrypted file
mod = ch + key;
if (mod > 255 ) mod -= 255;
// fout << mod; //Writes decrypted text to TTO.txt
line += mod;
if(mod == '\n')
{
Lines.push_back(line);
line = "";
}
}
fin.close(); //Cose the encrypted file
}