Tuesday, October 23, 2018

Pointer & Array

Pointer

Pointer is a variable that is used to store the address of another variable that has value. Pointer also have two operators which is (*) and (&).
Note =
1: Variable a is given the value of 99;
2: Ptr variable have the address of variable a, that means the value 99 is stored at memory address;
3:Variable b has the value of ptr variable, that means data or value of ptr variable is stored at variable b;


Array


An array is a collection of data items, all of the same type, accessed using a common name. A one-dimensional array is like a list  a two dimensional array is like a table.  The C language places no limits on the number of dimensions in an array, though specific implementations may. Some texts refer to one-dimensional arrays as vectors, two-dimensional arrays as matrices, and use the general term arrays when the number of dimensions is unspecified or unimportant.


No comments:

Post a Comment