Mercurial > hg > CbC > CbC_gcc
view CbC-examples/test_struct.c @ 103:edcadcec937d
modify __rectype
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 23 Mar 2012 17:11:33 +0900 |
parents | 4c6926a2b9bc |
children | 5d30d517ebed |
line wrap: on
line source
struct aaa{ int a; // 4 char b; // 1 int c; // 4 double d; // 8 char e[10]; //10 }; //27 --> 32 int main(int argc, char **argv){ struct aaa A; A.a = 10; A.b = 'A'; A.c = 20; A.d = 1.11; A.e[0] = 'A', A.e[1] = 'Z'; printf("sizeof aaa = %d\n", sizeof(struct aaa)); tset01( A, 10); return 0; } void tset01( struct aaa B, int size){ printf("B.a = %d\n", B.a); printf("B.b = %d\n", B.b); printf("B.c = %d\n", B.c); printf("B.d = %lf\n", B.d); B.e[9] = '\0'; printf("B.e = %s\n", B.e); printf("size = %d\n", size); }