9 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 },
10 { 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 },
11 { 1000, 1001 , 1002, 1003, 1004 , 1005, 1006, 1007, 1008, 1009}
18 void ctorArrObject(struct ArrObject *pThis, int i) {
22 void f(struct ArrObject *pThis) {
23 printf("num is %d\n", pThis->num);
26 static void pass_array_test(struct ArrObject *a, int a_len)
30 for(i = 0; i < a_len; i++) {
35 #define length(a) (sizeof(a)/sizeof((a)[0]))
37 int main(int argc, char *argv[]) {
39 struct ArrObject ao[10];
40 struct Arr2Object a2o[2];
45 for(i = 0; i < length(ao); i++)
46 ctorArrObject(&ao[i], i);
48 for(i = 0; i < 10; i++) {
52 pass_array_test(ao, length(ao));
54 for(i = 0; i < length(a2o); i++)
55 memcpy(&a2o[i], &arr_init, sizeof(arr_init));
57 for(i = 0; i < length(a2o[0].a); i++) {
58 memcpy(&a2, &a2o[0], sizeof(a2));
65 for(i = 0; i < length(a2o[0].a); i++) {
66 printf("%d\n", a2o[0].a[i]);
68 for(i = 0; i < length(a2o[1].a); i++) {
69 printf("%d\n", a2o[1].a[i]);
72 for(i = 0; i < length(a2o[0].b); i++) {
73 memcpy(&a2, &a2o[0], sizeof(a2));
78 for(i = 0; i < 10; i++) {
79 printf("%d\n", arr_init.inrom[i]);