I have two pointers,
char *str1;
int *str2;
If I look at the size of both the pointers let’s assume
str1=4 bytes
str2=4 bytes
str1++ will increment by 1 byte, but if str2++ it will increment 4 bytes.
What is the concept behind this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In the provided scenario:
The ++ operator increments the pointer by the size of the pointed type.