|
|
|
|
|
by satysin
3527 days ago
|
|
char *p;
p doesn't point to anything[0]. You have declared a pointer to char but not given it any memory to point to. It is uninitialised. *p = 'c';
So what are you dereferencing here? You can't dereference something you haven't initialised.[0] well it might point to something, it is up to the compiler as it is UB. Edit: btw if you could not answer this very simple problem please do not advertise yourself as a C programmer as you are not yet. Learn C and then advertise yourself as a C programmer. |
|