CPP

56
3027 reads

February 4, 2012

Pointers and arrays


Pointers and arrays
The concept of array is very much bound to the one of pointer.

170
3290 reads

February 4, 2012

Pointers2


Notice that even though we have never directly set a value to either firstvalue or secondvalue, both end up with a value set indirectly through the use of mypointer.

118
3148 reads

February 4, 2012

Pointers


Declaring variables of pointer types
Due to the ability of a pointer to directly refer to the value that it points to, it becomes necessary to specify in its declaration which data type a pointer is

127
2810 reads

February 4, 2012

Character Sequences


Using null-terminated sequences of characters

Null-terminated sequences of characters are the natural way of treating strings in C++, so they can be used as such in many procedures.

101
2971 reads

February 4, 2012

Arrays as parameters


Arrays as parameters
At some moment we may need to pass an array to a function as a parameter.

66
3103 reads

February 4, 2012

Arrays


Accessing the values of an array.

112
1735 reads

February 4, 2012

Declaring functions


Declaring functions.
Until now, we have defined all of the functions before the first appearance of calls to them in the source code.

113
1917 reads

February 4, 2012

Recursivity factorial calculator


Recursivity is the property that functions have to be called by themselves. It is useful for many tasks, like sorting or calculate the factorial of numbers.

108
1703 reads

February 4, 2012

Overloaded functions


Overloaded functions.
In C++ two different functions can have the same name if their parameter types or number are different.

108
1439 reads

February 4, 2012

Default values in parameters.


Default values in parameters.
When declaring a function we can specify a default value for each of the last parameters.