Monday, September 12, 2011

subtraction of using pointer

//subtraction of one pointer from another

#include<stdio.h>
#include<conio.h>
main()
{
    int a[]={10,20,30,45,67,56,74};
    int *i,*j;
    clrscr();
    i=&a[1];
    j=&a[5];
    printf("\n %d %d",j-i,*j-*i);
    getch();
    }

No comments:

Post a Comment

Popular 5 Posts Last 7 days