I have two void type arrays
Code:
void * shared;
void * private;
I want to copy elements from the private to the shared, but when I try, I get compile errors
Code:
int i;
for(i = 0; i<size; i++)
{
shared[i] = private[i];
}
I get
rvm.c:253: warning: dereferencing ‘void *’ pointer
rvm.c:253: warning: dereferencing ‘void *’ pointer
rvm.c:253: error: invalid use of void expression
If I try
Code:
int i;
for(i = 0; i<size; i++)
{
shared + i = private +i;
}
I get
rvm.c:253: error: invalid lvalue in assignment
it does not suffice to simply re-assign the pointers, as shared is allocated with mmap (with shared) and private is mmap (with private)
Thank you so much!