Mercurial > hg > CbC > old > device
annotate test/cext.c @ 831:a22aabb27786
pdecl_data type
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 03 Dec 2010 11:32:50 +0900 |
parents | 2a4a40168fa4 |
children | d712ee10feb7 |
rev | line source |
---|---|
467 | 1 int printf(const char *format, ...); |
353 | 2 |
3 unsigned int u; | |
831 | 4 static char current_file_dir[1024] ; |
5 | |
6 void | |
7 f(char *name) | |
8 { | |
9 char *s = name; | |
10 char *q = current_file_dir; | |
11 printf("%s and %s\n",s,q); | |
12 } | |
353 | 13 |
14 main() | |
15 { | |
16 int i,k; unsigned uk; | |
17 | |
808
2a4a40168fa4
char is unsigned on Yellow dog.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
491
diff
changeset
|
18 char c = -3; |
2a4a40168fa4
char is unsigned on Yellow dog.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
491
diff
changeset
|
19 printf("char is %ssigned\n", c==256-3? "un":""); |
2a4a40168fa4
char is unsigned on Yellow dog.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
491
diff
changeset
|
20 |
353 | 21 for(i=-3;i<4;i++) { |
22 k = (char) i; | |
23 uk = (unsigned char) i; | |
491 | 24 printf("#0011:%d %u\n",k,uk); |
353 | 25 k = (short) i; |
26 uk = (unsigned short) i; | |
491 | 27 printf("#0014:%d %u\n",k,uk); |
353 | 28 } |
29 u = (unsigned) -23432; | |
30 | |
491 | 31 printf("#0018:%d\n",u/(8048+5)); |
831 | 32 |
33 current_file_dir[0] = 'k'; | |
34 current_file_dir[1] = 'a'; | |
35 current_file_dir[2] = 't'; | |
36 current_file_dir[3] = 'e'; | |
37 current_file_dir[4] = 0; | |
38 f("john"); | |
353 | 39 return 0; |
40 } | |
41 |