main()
{
int x[0];
scanf("%s",x);
printf("%s",x);
}
Why this program not show any error when I input qwerty79 and this program give me output qwerty79?
main()
{
int x[0];
scanf("%s",x);
printf("%s",x);
}
Why this program not show any error when I input qwerty79 and this program give me output qwerty79?
In this you declare array of int x with 0 members means their no memory space allocated for an array and their is no memory location name x.So , their is no type checking when you are entered string in integer and one another reason is that compiler only know that there is some variable x but that type is not known because their is no memory allocation of x.So,your program not given any error.For detail info you must read compilation process state theory which is a part of the Compiler Design Subject.