[ create a new paste ] login | about

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

slevy1ster - C, pasted on Aug 16:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stdio.h>
int main() {
float snelheid;

unsigned char c[] = {0xcd, 0xcc, 0xe9, 0x42};

union u_tag {
   char b[4];
   float fval;
} u;

u.b[0] = c[0];
u.b[1] = c[1];
u.b[2] = c[2];
u.b[3] = c[3];

printf("%f", u.fval);
return 0;
}


Output:
1
116.900002


Create a new paste based on this one


Comments: