Finally.
I think I should write my own shared memory heap-like manager.
Doing the following I made it work properly.
Code:
SharedMemory *sm1 = new SharedMemory(SHAMEM_ID, 1600, true);
void *pool = sm1->Get(); test *tp = (test *)pool;
tp->c = (test2 *)(new SharedMemory ( SHAMEM_ID + 10, sizeof(test2) * 10, true ))->Get(); test *t = new test;
t->a = 123;
t->b = 234;
t->c = (test2 *) malloc(sizeof(test2) * 10);
t->c[0].a = 777;
t->c[7].a = 888;
Clone(t, pool);