C:
char kral[16] = "Kral "iyidir"";n char kralis[] = "Heheheha";n strcat(kral, kralis);n printf("%ld, %s", sizeof(kral), kral);
In this code I thought it will throw stack error, but it runs without error.But when I change array size of kral to 15, it throws stack error.
Error:
*** stack smashing detected ***: terminated
Aborted (core dumped)
My question is this: How 21 letter size string could settle into 16 bytes of RAM.And if can, why 15 bytes of RAM couldn’t?
Getting answer for my question
Qarvos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.