Pointer and Array

nama:Raymond Filan
nim:2201734184

A.Pointer
pointeri is a variablethat saves another address of a pointer
ex:int i,*ptr,**ptr,***ptr
ptr=&i
ptr_ptr = &ptr

*ptr=5  means i=5
**ptr=9 means i=9

B.Array
data saved in a certain structure to be accessed as a group or individually.some variables saved using the same name distinguish by their index

array charactheristic
-homogeus
 means all element have similar data

-random access
 each element can be reached individually,does not have to be sequential


One dimensonal array
means just have 1 array dimension
ex: A[]


two dimensional array
means have two array dimension
ex: A[][]


pointer constant&pointer variable
pointer variable:is pointer that can be assigned with new value at run time

pointer constant:a pointer that can not be assigned with new value at run-time

Array is Pointer Constantto its first element of the array. Array can be filled with pointer variable.





Comments