Why can I store more than 3 characters in the array "char array[3]" ? For example, in this code:
#include <stdio.h>
char array[3];
main()
{
scanf("%s", array);
putchar(array[5]);
return 0;
}
You can enter a text of any length, and it will print the 6th letter. You can also print the entire text with "printf("%s", array). Why does this work although the array only has space for 3 characters?