This is a guest post by a good personal friend of mine under the name Black Shadow.
Whenever we need to fill in an array, multiply a variable against a value multiple times or generally want to do the same stuff over and over, we use the C++ looping structures. They help us repeat the commands that we want to execute. We specify a set of commands to be executed according to a certain condition that we also define. While this condition is evaluated as true, the set of commands keeps executing, while when it becomes false, the looping structure ends. In general, the checking condition of a looping structure consists of a counter, that counts the number of times that the set of commands was executed. There are 3 different looping structures :
Each C++ program contains at least one function, main(), which signifies the entry point of the program. Think of functions as procedures that execute certain tasks. Functions consist of parameters that actually are auxiliary variables for them. Moreover, they need to return a value, whether that is an integer or a void (meaning no value at all). Whenever we declare a function, its prototype must end with a greek question mark (;)
This is a guest post by a good personal friend of mine under the name Black Shadow.
Control structures are a very useful programming idea. They help us execute a certain set of commands if a situation occurs. For instance, if a password that we ask a user to provide is correct, we evaluate it and present the user with a message. There are 3 primary control structures :
This is a guest post by a good personal friend of mine under the name Black Shadow.
In the C++ programming language, we use input data which, under the proper editing, return the awaited results as output data. These data must be stored in one or more memory places to be able to use them in the process of programming. Those different parts of memory where data is stored, represented by a name, are split into two different categories, variables and constants. Of course, there more than that, like pointers or structs, but these two are the main containers used and discussed in this post. The difference between them is that the variables can alter their defined values while constants get only one immutable (not changing) value while the program is executed and till it reaches the end. For that reason, for each variable, there should be a definition on how many memory positions they occupy and also the range of the values that they can contain. Hence, the size of a variable depends on the type that we define for it. The three most popular c++ variable types are :
I’ve decided to create a section in this blog in order to write some tutorials about one of my favorite programming languages, C++. In this series, i will be starting to talk about C++ basics and then go into more advanced stuff like function overloading, templates, classes inheritance and more. My hope is that in the end you will be able to find a whole source of interesting C++ tutorials that will help you learn the language and program effectively.