some quest not quite relay to Agent++

劉其堅 900213____itri.org.tw
Mon May 5 08:44:48 CEST 2003


I define a structure
typedef struct Alist_s{
      char a[256];
      char b[256];
      struct Alist *next;
}Alist;
and I want put three of this structure into shared memory

so I allocate 3*sizeof(Alist_s) in shared memory
and I use pointer of array to point to three structures in shared memory
Alist *array[3];
first one array[0] point to where shared memory begin ( shm_ptr :: this is
also the address of the first structure )
so I can use shm_ptr->a, shm_ptr->b to access first structure's elements
but how can I access the second and third structure's elements
best regards
chi-chien




More information about the AGENTPP mailing list