massive number (67); // announcement and initialization of long variable
long* pnumber;// Declaration of variable of face pointer to long.
Now with all the declarations out of the way, the developer can use the address-of operator & to store the address of any variable. Note* A pointer must have the same type (i.e.: int, double, char, etc.). An ensample of using the address-of operator is as follows:
long number (67);
long* pnumber;
pnumber = &number;
This will store the address of number into pointer variable pnumber.
An present is used to store a serial publication of elements into a number of memory locations. These elements are of the same type and are referenced through the same variable name.
drill of declaring an browse:
int numbers[5] = { 5, 10, 15, 20.
25};
This declaration will create an array like this:
0 1 2 34
510152025
numbers
The difference among one-dimensional and two- dimensional array is a two-dimensional array has more than one index value. An example is:
double corn[10][15];
The initiatory index number 10 can be referred to as how many rows the array has, whereas, the second index number 15 is the number of columns. So with this array, there will be cl double types of corn.If you want to get a full essay, baffle it on our website: Orderessay
If you want to get a full essay, wisit our page: write my essay .
No comments:
Post a Comment