Wednesday, 19 March 2014

C Program for Subtraction of one pointer from another

/* Subtraction of one pointer from another */
main( )
{
int  arr[ ] = { 10, 20, 30, 45, 67, 56, 74 } ;
int  *i, *j ;
i = &arr[1] ;
j = &arr[5] ;
printf ( "%d %d", j - i, *j - *i ) ;
}

No comments:

Post a Comment