explain me the output please .As far as my knowledge. a is a character type pointer variable and its size should be 4 bytes irrespective of what its pointing to.but i get a result =50.
*a is the value of a[0] and its size is rightly 1 byte.
but how can the size of that variable change to 4 byte when i just add 7 to it(although i don't store the added result anywhere)
Code:
#include<stdio.h>
int main(){
char a[50];
printf("\n%d ",sizeof(a));
printf("\n%d ",sizeof(*a));
printf("\n%d ",sizeof(*a+7));
return 0;
}
output: