Cout?

TitanMATRIX

In Runtime
Messages
202
Hi all!,

I'm learning C++ from this tutorial (And I must admit it is THE BEST tutorial I have read ever. I am learning it so quickly) from learncpp.com. I just created the famous "Hello World!" program... but I'm still not sure what the "cout" does... Does that tell it to output "Hello World!" (or whatever you want printed out) in the windows Cmd?
 
cout is a bit like the infamous printf, it'll just print out something to the terminal. There are some differences (printf returns the number of characters printed, cout doesn't return anything, cout is a bit faster because it hasn't got as many overheads as printf but printf is more flexible as a result) but if you're just after basically what it does then yes - it'll just print to the terminal :)
 
Yeah I should've read farther ahead. It explains it further in the next chapter lol :) I love programming, I'm finding it really fun!
 
shouldn't it be "cin >>" not "cin <<" because its user input while cout has the operator going << that way?
 
Back
Top Bottom