C言語なら、俺に聞け! <26>
■ このスレッドは過去ログ倉庫に格納されています
0273デフォルトの名無しさん
NGNG#include <stdio.h>
#include <stdlib.h>
struct Test{
int test01;
char test02[2];
};
int main ()
{
int i;
struct Test *test;
test = (struct Test *) calloc (3, sizeof(struct Test));
test[0]->test01 = 10;
test[0]->test02 = 'a';
test[1]->test01 = 20;
test[1]->test02 = 'b';
test[2]->test01 = 30;
test[2]->test02 = 'c';
for (i=0; i<3; i++) {
printf("%d %s", test[i]->test01, test[i]->test02);
}
return 0;
}
試してないが。
■ このスレッドは過去ログ倉庫に格納されています