I set a char array of size of 10 and want to check the real size of the input permitted.
I tested
123456789; 1234567890; 123456789123456789
Interestingly, all of them passed and got the right output which are
123456789; 1234567890; 123456789123456789
It confused me a lot because I thought the last two are wrong input.
Does that make sense or is it a compiler difference?
This is the code
#include <stdio.h>
main()
{
char input[10];
scanf("%s", input);
printf(input);
} '