In brief my code is,
#include <stdio.h>
int main()
{
int n;
scanf("%d", &n);
while(n != 0)
{
scanf("%d", &n);
printf("%d\n", n);
}
return 0;
}
It was written for integer
input. But if I input a character
instead (although n is decleared as integer
), the loop goes infinite and prints the last integer
input value. If I input a character
at first it seems like it prints a memory address. My question is, what is happening here if I input a character
instead an integer
?