愚直な例です。
#include <stdio.h>
#include <stdlib.h>
typedef struct _MEMBER {
char *name;
int age;
char *address;
} MEMBER;
MEMBER *memcat(MEMBER *member, int sz, MEMBER *member2, int sz2)
{
MEMBER *mem;
int i, j;
mem = (MEMBER *) malloc(sizeof(MEMBER) * (sz + sz2));
if (!mem) return NULL;
for (i = 0; i < sz; i++) {
mem[i] = member[i];
}
for (j = i; j < i + sz2; j++) {
mem[j] = member2[j-i];
}
return mem;
}
int main(void)
{
MEMBER member[] = {
{ "山田", 25, "東京都aaaaa" },
{ "木村", 30, "東京都bbbbb" },
{ "森田", 24, "東京都ccccc" },
};
MEMBER member2[] = {
{ "伊藤", 23, "大阪府ddddd" },
{ "山野", 31, "大阪府eeeee" },
};
MEMBER *mem;
int sz = sizeof(member) / sizeof(member[0]);
int sz2 = sizeof(member2) / sizeof(member2[0]);
int i;
mem = memcat(member, sz, member2, sz2);
if (!mem) exit(1);
for (i = 0; i < sz + sz2; i++) {
printf("%s %d %s\n", mem[i]);
}
free(mem);
return 0;
}