of the array, we can simply use ptr++. Value is incremented according to the datatype of the value to which the pointer is pointing. For example, if the pointer is pointing to any integer value (having 64 bit integer), incrementing its value will increase its value by 4 whereas in case of ‘char’, value will increase by 1.
Code:
#include<stdio.h>
int main(){
int num =50;
char a = 'x';
// pointer 'ptr' to point the above 'num' and 'ptr1' to point 'a'
int *ptr;
char *ptr1;
// pointer 'ptr' holding the address of 'num' location and 'ptr1' to hold the address of character 'a'
ptr = #
ptr1 = &a;
printf("\n The address which the pointer holds is %u",ptr);
printf("\n The address which the pointer holds is %u",ptr1);
// incrementing the value of pointer by 1
ptr++;
ptr1++;
// Pointer address will now gets incremented by 4 bytes as it holds the address of integer value
printf("\n Now the address which the pointer holds is %u",ptr);
// Pointer address will now gets incremented by 1 byte as it holds the address of character value
printf("\n Now the address which the pointer holds is %u",ptr1);
return 0;
}