I want to output a new line into a text file but i dont know how please help
Ex:
jaime adf
new line
I want to output a new line into a text file but i dont know how please help
Ex:
jaime adf
new line
Code:#include <fstream> #include <iostream> ... std::ofstream file("MyFile.Txt"); if( file.is_open() ) { file << std::endl; // endl writes a newline character to the file file << '\n'; // This does the same thing file.put('\n'); // Also does the same thing }
"Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
-Christopher Hitchens
Print this string the way you want:
Note the '\n' char which represents a newline char.Code:"jaime adf\nnew line"