Professional Documents
Culture Documents
Array
Array
Array
main( )
{
int arr[ ] = { 10, 20, 30, 45, 67, 56, 74 } ;
int *i, *j ;
i = &arr[1] ;
j = &arr[5] ;
printf("%d \n %d\n", i, j);
printf("%d \n %d\n", *i, *j);
printf ( "%d %d", j - i, *j - *i ) ;
}
Pointer variables can be compared provided both variables point to objects of the
same data type.
display ( &num[0], 6 ) ;
display ( num, 6 ) ; display is a function, both statements are same