- #1
- 2,607
- 802
Yesterday afternoon, instead of doing real meaningful work I was screwing around with <threads> on my Debian box at work. I've been spending some time looking at converting some of our codes and working on getting them parallelized better. Like most legacy codes, the parallel part was really an afterthought. So on to my question. The basic hello world via threads works pretty well but I noticed a quirk in the output. When I tried to use
to end the line and add a newline, it didn't work, but if I typed in
the next output line was on the next line. Anyone ever seen this before? The code compiles correctly without any errors, just doesn't behave as I would expect. Now I didn't try it with another program, although I did write a hello world to play with the g++ compiler previously and didn't see this issue.
Code:
std::cout << ... << std::endl;
to end the line and add a newline, it didn't work, but if I typed in
Code:
std::cout << "...\n";
the next output line was on the next line. Anyone ever seen this before? The code compiles correctly without any errors, just doesn't behave as I would expect. Now I didn't try it with another program, although I did write a hello world to play with the g++ compiler previously and didn't see this issue.