view test/strinit.c @ 515:3d921f7a8e74

*** empty log message ***
author kono
date Mon, 26 Dec 2005 09:18:36 +0900
parents a379da780856
children 492f06738550
line wrap: on
line source

#include <stdio.h>

int b[3] = {1,2,3};

struct temp {
   int a;
   int b;
   int c;
   int d;
   int e;
} temp1 = {
//   101,
//   102,
//   103,
//   104,
//   105,
   .e = 5,
   .a = 3
};

struct temp temp3 = {
   .c = (int)&b,
   .d = -10,
   .a = (int)b
};



main()
{
    struct temp temp2 = { .c = 5, .e=99 };
    printf("#0031:1: %d\n",temp1.a);
    printf("#0032:1: %d\n",temp1.e);
    printf("#0033:1: %d\n",temp1.b);
    printf("#0034:2: %d\n",temp2.c);
    printf("#0035:2: %d\n",temp2.e);
    printf("#0036:2: %d\n",temp2.b);
    printf("#0037:2: %d\n",(void*)temp3.c==b);
    printf("#0038:2: %d\n",temp3.c==(int)b);
    printf("#0039:2: %d\n",temp3.a==(int)&b);
    return 0;
}