The address stored in pointer increments to next block instead of increasing the address value by one point. Why?
Asked
Active
Viewed 246 times
1 Answers
-2
that is the reason we have different types of pointers and the move to next block acc. to their data type's size...since that is the most useful way... if suppose it would be acc. to your query...take an example:-
`
int temp[]={5,5};
int *point=temp;
*(point++);
printf("%d",*point);
`
here if the int pointer named point
incremented address value by one...then..since we know that an int variable takes 2 bytes..so if the pointer incremented by one byte...then it would point in between of the int data type... which wont show the exact data stored on that location..and therefore it wont be useful of using that pointer...

Shreyan Mehta
- 550
- 5
- 17