void *copy_element(const void *src[], int cnt, size_t size)
{
void *result = 0;
char *p;
size_t num = 0;
for(int i = 0;i < cnt;i++)
{
num += size;
result = realloc(result, num);
if(!result) break;
if(!i) p = (char *)result;
memcpy(p, (const char *)src[i], size);
p += size;
}
return result;
}
int main()
{
const void *p[2] = {"abc", "123"};
void *result = copy_element(p, 2, 3);
char *q = (char *)result;
for(int i = 0;i < 6;i++) printf("%c", q[i]);
free(result);
cout << endl;

return 0;
}