Pointer types are often used as a parameter for function calls. As you pass on arguments to C, in order for a function to modify the value from the calling, the value index must be passed. References to structures are also used as function arguments even if there is nothing in the structure that changes in the function. This is so as to avoid copying the entire contents of the structure onto the stack.
Pointer Deferencing
To access a value to which a pointer points, the * operator is used. Another operator, the -> operator is used in conjunction with pointers to structures. Here's a short example.
c = 10;
pj = &c; /* pj points to c */
d = *pj; /* d is assigned the value to which pj points, 10 */
pj = &d; /* now points to d */
*pj = 12; /* d is now 12 */
What is array?
An array is a container object that contains a specified number of values of a specified value. The array length is created when the array is created. After the creation, the length is fixed.

An array of 10 elements.
Each element in the array is called an element, and its numeric index is available for each element. As shown in the previous figure, the numbering starts with 0. For example, item 9 is available for index 8.
By :Steven
2201852132
Computer Science and Statistics
2201852132
Computer Science and Statistics
No comments:
Post a Comment