Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 08-07-2009, 01:27 AM   #1
In Runtime
 
TitanMATRIX's Avatar
 
Join Date: Jul 2009
Posts: 202
Send a message via MSN to TitanMATRIX
Default Cout?

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?
__________________

__________________
***Network Warrior***
TitanMATRIX is offline   Reply With Quote
Old 08-07-2009, 01:13 PM   #2
Site Team
 
berry120's Avatar
 
Join Date: Jul 2009
Location: England, UK
Posts: 3,425
Default Re: Cout?

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
__________________

berry120 is offline   Reply With Quote
Old 08-08-2009, 09:05 PM   #3
In Runtime
 
TitanMATRIX's Avatar
 
Join Date: Jul 2009
Posts: 202
Send a message via MSN to TitanMATRIX
Default Re: Cout?

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!
__________________
***Network Warrior***
TitanMATRIX is offline   Reply With Quote
Old 08-08-2009, 09:44 PM   #4
Guru
 
JogaBonito1502's Avatar
 
Join Date: Jan 2008
Location: U.S.
Posts: 7,841
Default Re: Cout?

Try using "cin <<"
JogaBonito1502 is offline   Reply With Quote
Old 08-09-2009, 01:44 AM   #5
In Runtime
 
TitanMATRIX's Avatar
 
Join Date: Jul 2009
Posts: 202
Send a message via MSN to TitanMATRIX
Default Re: Cout?

shouldn't it be "cin >>" not "cin <<" because its user input while cout has the operator going << that way?
__________________
***Network Warrior***
TitanMATRIX is offline   Reply With Quote
Old 08-09-2009, 02:27 PM   #6
88
Fully Optimized
 
88's Avatar
 
Join Date: May 2005
Posts: 4,775
Send a message via MSN to 88
Default Re: Cout?

Quote:
Originally Posted by TitanMATRIX View Post
shouldn't it be "cin >>" not "cin <<" because its user input while cout has the operator going << that way?
Yes he meant "cin >>". I believe he would not make that mistake intentionally.
__________________
Killing under the cloak of war is no different than murder

Kein Alkohol ist auch keine Lsung!
88 is offline   Reply With Quote
Old 08-09-2009, 03:20 PM   #7
Guru
 
JogaBonito1502's Avatar
 
Join Date: Jan 2008
Location: U.S.
Posts: 7,841
Default Re: Cout?

Quote:
Originally Posted by 88 View Post
Yes he meant "cin >>". I believe he would not make that mistake intentionally.
It has been a while since I last programmed
JogaBonito1502 is offline   Reply With Quote
Old 08-11-2009, 12:43 AM   #8
In Runtime
 
TitanMATRIX's Avatar
 
Join Date: Jul 2009
Posts: 202
Send a message via MSN to TitanMATRIX
Default Re: Cout?

Quote:
Originally Posted by 88 View Post
Yes he meant "cin >>". I believe he would not make that mistake intentionally.
Just makin sure thats all...
__________________
***Network Warrior***
TitanMATRIX is offline   Reply With Quote
Old 08-13-2009, 01:14 AM   #9
Daemon Poster
 
RewtGuy's Avatar
 
Join Date: Dec 2004
Posts: 595
Send a message via AIM to RewtGuy
Default Re: Cout?

http://www.cplusplus.com/reference/iostream/cout/

there you go. first result in google. damn aren't we lazy today.
__________________

__________________
Windows: A thirty-two bit extension and GUI shell to a sixteen bit patch to an eight bit operating system originally coded for a four bit microprocessor and sold by a two-bit company that can't stand one bit of competition.
RewtGuy is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 04:22 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0