//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();
}
#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