int main()
{
int x;
float y;
char c;
x = -4443;
y = 24.25;
c = 'M';
printf("\nThe value of integer variable x is %f", (float)x);
printf("\nThe value of float variable y is %d", y);
printf("\nThe value of character variable c is %f\n",c);
return 0;
}
输出:
The value of integer variable x is -4443.000000
The value of float variable y is 0
The value of character variable c is 24.250000
为什么我没有得到预期的输出?
但是当我使用外部铸造时,我得到了预期的输出:
The value of integer variable x is -4443.000000
The value of float variable y is 24
The value of character variable c is 77.000000