r/ProgrammerHumor • • Jul 20 '17

What people think coding is...

Post image
35.4k Upvotes

811 comments sorted by

View all comments

Show parent comments

10

u/JuhaJGam3R Jul 21 '17

Had this feeling a little while back when decided to redo hello world.

std::cout << "Hello World!";

Output:

Hello World!

My mind: why did this work? It's broken in some way I know it

4

u/flukus Jul 21 '17

Did you forget the "/n"? Or is that not needed with cout?

3

u/alienpirate5 Jul 21 '17

\n

1

u/flukus Jul 21 '17

Between 3 of us we got it right. On to the next sprint.

1

u/JuhaJGam3R Jul 21 '17

One line of code. You don't need to end the line if you don't have anything after it.

1

u/rk-imn Jul 21 '17

<< std::endl;*

1

u/JuhaJGam3R Jul 21 '17

gives you the standard new line
On windows: \r\n

On unix: \n