4 ms·
A quick question about c++ in std::cout << "Whoopee." << std::endl; is std::endl putting a newline char after "Whoopee. "? Anyway in the C example it could ha
by dimitar 17y ago
A quick question about c++
in std::cout << "Whoopee." << std::endl;
is std::endl putting a newline char after "Whoopee. "?
Anyway in the C example it could have been written puts("Whoopee."); instead of printf("Whoopee. \n");
puts() places a \n after the char * it accepts as an argument.
I'm sorry for the triviality here :)
- stonemetal 17y agostd::endl will insert a new line, but it also flushes the buffer. So use'\n' when you need a new line and don't want to flush the output buffer.
- deleted 17y ago[deleted]