I have the following code:
int main(int argc, char *argv[]) { char ch[10]; printf(\"String 10 max. :: \"); gets( ch ); printf(\"String: %s\\n\", ch)
Buffer overflow is undefined behaviour. It may crash, but no one guarantee that. In most compilers, the stack grows down, so you probably override main's return address, but the call to printf doesn't override your string.
main
printf