B
bob
I can't get 'number' to print like I think it should:
int main()
{
int number;
printf("two digit number please:\n");
fread(&number, sizeof(int), 1, stdin);
printf("your number is: %d\n", number);
return 0;
}
the last printf gives me the address (I think so, anyway) of 'number'.
Also after the first printf I get a newline as expected, ..i enter say
45..hit enter...and another newline pops up.....why? Then finally the
last print f prints teh address as i mentioned.
if I replace int with char then things work like I would expect.
Thanks
int main()
{
int number;
printf("two digit number please:\n");
fread(&number, sizeof(int), 1, stdin);
printf("your number is: %d\n", number);
return 0;
}
the last printf gives me the address (I think so, anyway) of 'number'.
Also after the first printf I get a newline as expected, ..i enter say
45..hit enter...and another newline pops up.....why? Then finally the
last print f prints teh address as i mentioned.
if I replace int with char then things work like I would expect.
Thanks