Algorithm & Programming (Array and Pointer)
Algorithm & Programming (Array and Pointer) Pointer Pointer is variable that store address of another variable. Pointer which is mostly used : *(content of) and &(address of). Example: int i, *ptr; ptr = &i; To assign a new value to the variable pointed by the pointer: * ptr = 5; / * means i=5 */ Pointer to pointer is pointer for address to another pointer. Pointer constant : a pointer that can be assigned with new value at run-time. Array is pointer constant. Pointer variable : a pointer that can not be assigned with new value at run-time. Array Array is data saved to be access as a group or individually. Characteristic: 1. Homogenous = all element have similar data type. 2.Random access = doesn't have to be sequential. Array Initialization Example : B[4]={1,2,5,} One Dimensional Array Syntax: type array_value [value_dim] ; Example : int number[10000]; Two Dimensional Array Syntax : type name_arr...