![]() |
|
[C] C++ Beginners Tutorial Part II - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [C] C++ Beginners Tutorial Part II (/showthread.php?tid=2091244) Pages: Pages
1
2
|
C++ Beginners Tutorial Part II - ryan⚜ - Jan 15, 2012 Chapter II - Variables, Expressions and Interactivity Intro: We'll be going over a few simple things; the cin statement, different expressions and initiating variables. Be sure to read my past tutorial in order to obtain a full understanding of this tutorial which can be found here. Each chapter will build on the one before. Let's begin. An important part to learning the basics of C++ is learning about variables and expressions. Like math, you have variables which can represent almost anything. Below is an example of using a simple variable and assigning a value to it. [img]http://i.minus.com/iblrUSqDIAi6ih.png[/img] As you can see, we can make a variable, assign it a value and have it send the output to the console. Not only, can we assign variables, but we can also do calculations with them as well. [img]http://i.minus.com/i4pFJKdAQwKqR.png[/img] Now that we have come this far, we can learn about cin statements. cin statements - Just as cout is C++'s standard output object, cin is the standard input object. It reads input from the console (or keyboard). Using cin opens up a ton of new possibilities. Rather than assigning a value manually, we can have the console read values as well. [img]http://i.minus.com/ibhNbe7kmEQU45.png[/img] There are a variety of different operators you can learn. Some arithmetic operators include: Code + additionDon't feel like reading? Feel free to watch the video below. In my next tutorial we'll go over different data types, loops and some more uses of everything we've learned so far. If you have any suggestions, please comment below. Also, if you have any questions about anything we've discussed, feel free to PM me. Thanks! * - BigDomePiece - Jan 15, 2012 wow! Very useful, I have liked both of these tuts. Keep them coming! * - ryan⚜ - Jan 15, 2012 (Jan 15, 2012 04:50 PM)BigDomePiece Wrote: wow! Thanks mate, much appreciated! 🤝 * - Mizz Blaise - Jan 16, 2012 Keep it up. So far so good. Are you eventually cover everything? Like pointers/references, etc...? * - ryan⚜ - Jan 16, 2012 (Jan 16, 2012 06:42 AM)Mizz Blaise Wrote: Keep it up. So far so good. Are you eventually cover everything? Like pointers/references, etc...? I don't know if I'll ever cover EVERYTHING, but yeah I'm going to cover quite a bit. We'll get out of console soon enough and start working on actual programs. * - Mizz Blaise - Jan 16, 2012 (Jan 16, 2012 11:28 AM)Regios Wrote: I don't know if I'll ever cover EVERYTHING, but yeah I'm going to cover quite a bit. We'll get out of console soon enough and start working on actual programs. What do you plan on covering for GUI? DirectX, or what? * - Trinitite - Jan 16, 2012 Better than my teacher in school! +rep for this and keep them coming! * - rhwarrior - Jan 16, 2012 thank you for this tutorial mate, was able to create a simple euro to dollar conversion tool without ANY programming experience. you've kept it easy to learn, unlike some other tutorials i tried. really looking forward to what you write next. any chance on sharing when can we expect the next steps? * - ryan⚜ - Jan 16, 2012 (Jan 16, 2012 01:49 PM)rhwarrior Wrote: thank you for this tutorial mate, was able to create a simple euro to dollar conversion tool without ANY programming experience. you've kept it easy to learn, unlike some other tutorials i tried. really looking forward to what you write next. any chance on sharing when can we expect the next steps? I'm glad I could help you out! Umm, I'm planning on releasing the next one by Friday at the latest. It'll be mostly over loops. * - Black_Mamba - Jan 16, 2012 Wow amazing tutorial, I easily remembered everything within both except I keep forgetting what #namespace, iostream does but I remember they go on the top :) * - Sports. - Jan 16, 2012 These tutorials are amazing and recommend them to anyone who is even curious about learning to code C++ * - BigDomePiece - Jan 16, 2012 Where is part 3!?!?!?! He said the next one would come out by friday.. =[ * - Rixxon - Jan 16, 2012 Nice tutorial man. These will certainly be helpful for those beginning C++. * - sanoonas - Jan 17, 2012 These are amazing! Thank you for all the help you are giving to us in these tutorials. * - Kipz - Jan 17, 2012 Or... you could read a book written by PROFESSIONALS. |