int main( ){
char a[2];
char *p;
p=&a[0];
*(p+5)='g';
}
In the above program I defined a pointer pointing to char array but the array is 3 bytes only. Let me tell you more clearly,for instance let us assume the char array address is 1000 so it takes upto 1003 bytes, but using a pointer I am storing an ASCII value of 'g' at 1005 location. Is that okay with the compiler ? Is that memory an static alloacted one ? or Can be used again ? Will that value be permanently stored in it or no?