Friday, July 31, 2009

Learning c++?

i understand iostream and cout, can you give me something i can learn to do more stuff with? like cin or something? how do i use cin? what does it do?





please help.





thank you.

Learning c++?
Cin is an input command. Here's an example:





cout %26lt;%26lt; "Enter name: ";





string name;


cin %26gt;%26gt; name;





cout %26lt;%26lt; "\n\nYour name is: " %26lt;%26lt; name;





This program would ask the user for his name and then dislay output it.





If you want to learn C++ well, use "C++ for Dummies". This book helps you learn quickly.





Good luck!!! ;-)
Reply:cin is the function for getting data from a user:





Example:





cin%26lt;%26lt;var
Reply:cin is how you get input from the user via the console prompt.





This is how you get an integer for example;





int i;


cin %26gt;%26gt; i;





I learned C++ (almost 10 years ago and have been using it ever since) from the Deitel %26amp; Deitel book series. Their newest edition is at http://www.amazon.com/Program-Harvey-Pau... if you wanna invest in a great C++ book. Otherwise, there are countless tutorials online.


No comments:

Post a Comment