[ create a new paste ] login | about

Link: http://codepad.org/n76EVlM1    [ raw code | output | fork ]

C, pasted on Jul 4:
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <stdio.h>
int main()
{
float a = 12.5;
int result = printf("%d\n", a);
printf( "result = %d\n", result );
result = printf("%f\n", a);
printf( "result = %d\n", result );
result = printf("%d\n", *(int *)&a);
printf( "result = %d\n", result );
printf("%d %d\n", sizeof(float), sizeof(int) );
return 0;
}


Output:
1
2
3
4
5
6
7
0
result = 2
12.500000
result = 10
1095237632
result = 11
4 4


Create a new paste based on this one


Comments: