This is my code:
#include
#include
using namespace std;
int main()
{
ifstream ifile (\"input.dat\", ios::in);
ofstre
std::endl already inserts a linebreak, so you have linebreaks in your file. I assume you are generating your file on a LF system (Linux or other UNIX-like) and viewing it on a CRLF system. In this case, your linebreak won't show in the text editor as a linebreak. unix2dos
is your friend.
Replace std::endl
with "\r\n"
to get CRLF instead of just LF.