pointer arithmetic

Address + Number= Address
Address - Number= Address
Address - Address=Number
Address + Address=Illegal
Example:
void main(){
float *ptr=(float *)5000;
ptr=ptr+5;
clrscr();
printf("%d",ptr);
getch();
}
Output:
5020

No comments: