hello again, fellow hackers! sorry for the delay, but i will be rolling out tutorials again! in this tutorial, we will talk about how to get user input and store it in a variable. then we will print out that variable.
Step 1: Fire Up Ubuntu and Open a Text Editor
your first step is of course to fire up Ubuntu and open a text editor. then paste this code in your main.cpp file and compile it. now run it. you'll see that our program asks us to enter a message, then it prints it out on a new line.
BE AWARE! cin can't detect non ascii characters (i'll cover the ascii table later), such as spaces. to us a space in your message, just use a underscore instead.
Explanation Time!
when we read through the code, we can see that we first declare a string variable, called Message. then we prompt the user to enter some text. then we use cin, and command it to store the input it gets in the Message variable. then we print out what is in the message variable.
take note that in cin, the arrows point to the right, opposed to the arrows of cout, which point to the left. but take especially note that the arrows of cin point to the variable, meaning "put the value you get in this variable." and the arrows pointing to the left in cout basically mean "put this value in cout to print out".
take note that cin can be used with any variable, but then you must make sure you don't enter a string when you are looking for an integer!
that is it for now folks! i know, a little bit of a short tutorial, but there isn't much to cin, really. in part 9, we will stop using a text editor and install my favorite IDE, CodeBlocks. (i will talk then about what an IDE is and why i love CodeBlocks so much) and in part 10, we will write our first, basic computer virus!
if you have any questions or problems, feel free to comment below or PM me!
-Phoenix750
Have used AVG protection for a couple of years now, I recommend this product to you all.
ReplyDeleteDo you need to increase your credit score?
ReplyDeleteDo you intend to upgrade your school grade?
Do you want to hack your cheating spouse Email, whatsapp, Facebook, instagram or any social network?
Do you need any information concerning any database.
Do you need to retrieve deleted files?
Do you need to clear your criminal records or DMV?
Do you want to remove any site or link from any blog?
you should contact this hacker, he is reliable and good at the hack jobs..
contact : cybergoldenhacker at gmail dot com