У меня есть endl, но он не входит в мой файл, поэтому, когда я вхожу в более чем 1 строку, все это в одной строке в блокноте.
Я пробовал:
codeFile << codeLine;
codeFile << endl; </p>
Я также пытался добавить "\ n" к строке, добавив в нее постоянную строку, но она не работает.
//Writing Coded Lines to File:
if(codeFile)
{
//Relaying Feedback to User:
cout << "File has been successfully opened/created" << endl;
cout << "\nWriting to file..." << endl;
for(int i = 0; i < lines; i++)
{
//Getting Non-Coded Line from User:
cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
cin.getline(line, length);
//Creating Copy of Line:
strcpy(cline, line);
//Gathering Line Length:
length = strlen(line);
//Coding Line:
codedLine = code(length, line, cline, sAlphabet);
//Coded Line Test
cout << codedLine;
//Writing to File:
codeFile << codedLine << endl;
}
}
//Closing File:
codeFile.close();
cout << "\nFile has now been closed";
}