Weird output of scanf and printf.
I've come up with the following program:
Code:
#include <stdio.h>
int main()
{
int a;
printf( "Enter a number: " );
scanf( "%d", &a );
printf( "You entered %d \n", a );
getchar();
printf( "You entered %d", &a );
getchar();
}
The program runs and puts this out:
Code:
Enter a number: 1
You entered: 1
You entered: 37814108
It doesn't mattter which number I put in, the 37814108 will still be the output.
I'm using Bloodshed Dev 4. Is this a strange output, or is it normal?
Thank You.