Class Presentation Array Of Pointers Submitted By- Sharad Dubey Submitted To- Prof . Nitin Paharia Sir
Array A collection of homogeneous data items that are stored at contiguous memory locations. Syntax of declaring Array Variable :- data_type variable_name [size] Example: - float s_height[40]; Syntax of accessing array elements:- variable_name [index] Example : - s_height[3]=5.4; sum=sum+s_height[3];
Pointer A pointer is a variable that can hold the address of another variable. Syntax of declaring pointer variable :- data_type*variable_name Example :- int*a ; char*a ; Where,* is used to denote that “a” is pointer variable and not a normal variable.
Array Of Pointers Array Of Pointers is a linear consecutive sequence of memory locations each of which represents a pointer. We can assign pointers as an Array Of Pointer with the following syntax- data_type *pointer_name[size] Example :- int*ptr[10]; Here, ptr refers to an array of 10 pointers.