[ create a new paste ] login | about

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

C, pasted on Jan 24:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include<stdio.h>
main()
{
int32_t num = 9;
int32_t b0,b1,b2,b3,b4,b5,b6,b7;
int32_t res = 0;

b0 = (num & 0xf) << 28;
b1 = (num & 0xf0) << 24;
b2 = (num & 0xf00) << 20;
b3 = (num & 0xf000) << 16;
b4 = (num & 0xf0000) << 12;
b5 = (num & 0xf00000) << 8;
b6 = (num & 0xf000000) << 4;
b7 = (num & 0xf0000000) << 4;

res = b0 + b1 + b2 + b3 + b4 + b5 + b6 + b7;

printf("%d\n", res);


Output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
In function 'main':
Line 4: error: 'int32_t' undeclared (first use in this function)
Line 4: error: (Each undeclared identifier is reported only once
Line 4: error: for each function it appears in.)
Line 4: error: expected ';' before 'num'
Line 5: error: expected ';' before 'b0'
Line 6: error: expected ';' before 'res'
Line 8: error: 'b0' undeclared (first use in this function)
Line 8: error: 'num' undeclared (first use in this function)
Line 9: error: 'b1' undeclared (first use in this function)
Line 10: error: 'b2' undeclared (first use in this function)
Line 11: error: 'b3' undeclared (first use in this function)
Line 12: error: 'b4' undeclared (first use in this function)
Line 13: error: 'b5' undeclared (first use in this function)
Line 14: error: 'b6' undeclared (first use in this function)
Line 15: error: 'b7' undeclared (first use in this function)
Line 17: error: 'res' undeclared (first use in this function)
Line 19: error: expected declaration or statement at end of input


Create a new paste based on this one


Comments: