+ 1
I have allocated space only for 3 characters. But y I could print more than 3
char a[3]; gets (a) ; printf ("%s", a) ;
3 Respuestas
+ 4
This array gives contigous memory of 3 but it is still possible that a[3] which is the memory location just after a[2] is available so you are able to use it.
Conclusion: It is a matter of chance that a[3], a[4], a[5] etc. can be used by your code.
+ 1
Thanks got you all😊👍