A function can call itself. This is called recursion, and recursion can be direct or indirect. It is direct when a function calls itself; it is indirect recursion when a function c
Read tutorial ↗For every parameter you declare in a function prototype and definition, the calling function must pass in a value. The value passed in must be of the declared type.
Read tutorial ↗Functions return a value or return void. Void is a signal to the compiler that no value will be returned.
Read tutorial ↗The arguments passed in to the function are local to the function. Changes made to the arguments do not affect the values in the calling function. This is known as passing by value
Read tutorial ↗Variables defined outside of any function have global scope and thus are available from any function in the program, including main().
Read tutorial ↗The conditional operator (?:) is C++'s only ternary operator; that is, it is the only operator to take three terms.
Read tutorial ↗It is worth noting that any statement can be used in an if or else clause, even another if or else statement. Thus, you might see complex if statements in the following form:
Read tutorial ↗Normally, your program flows along line by line in the order in which it appears in your source code. The if statement enables you to test for a condition (such as whether two vari
Read tutorial ↗Both the increment operator (++) and the decrement operator(--) come in two varieties: prefix and postfix. The prefix variety is written before the variable name (++myAge); the pos
Read tutorial ↗Enumerated constants enable you to create new types and then to define variables of those types whose values are restricted to a set of possible values. For example, you can declar
Read tutorial ↗While main() is a function, it is an unusual one. Typical functions are called, or invoked, during the course of your program. A program is executed line by line in the order it ap
Read tutorial ↗When you are writing a program, it is always clear and self-evident what you are trying to do. Funny thing, though--a month later, when you return to the program, it can be quite c
Read tutorial ↗