I declared a character array and at the time of taking input I used %d instead of %s in function scanf. Isnt my compiler suppose to flash an error for this? Or is it, due to some reason, not considered as compile time error ?
Or is it, due to some reason, not considered as compile time error
Correct. The compiler does NOT check for correspondence between a format string and arguments in a scanf statement. Even at run time, there is no type checking of arguments. Arguments are blindly interpreted per the format string.