Original Post
If I write a function for a threaed and pass an array of chars, it works fine: I call the above function in main() like this: scramble_thread=SDL_CreateThread(permutify, rgcscrambler); But when I try to use an integer array it won't compile. I do this: Now it won't compile. It says: I think it just doesn't like me trying to access elements of a void*, like it won't believe me when I tell it it's an array or something. I don't know.
int permutify(void *data)
{
char rgcval[50];
strcpy(rgcval,(char*)data)
//cut out lots of code
}
int permutify(void *data)
{
int istore;
//cut out lots of code
istore=(int*)data[j]; //this is lines 49, 50, and 51
(int*)data[j]=(int*)data;
(int*)data=istore;
//cut out lots of code
}
/home/icecube/zodiac2/src/permute.cpp: In function 'int permutify(void*)':
/home/icecube/zodiac2/src/permute.cpp:49: error: pointer of type 'void *' used in arithmetic
/home/icecube/zodiac2/src/permute.cpp:49: error: 'void*' is not a pointer-to-object type
/home/icecube/zodiac2/src/permute.cpp:50: error: pointer of type 'void *' used in arithmetic
/home/icecube/zodiac2/src/permute.cpp:50: error: 'void*' is not a pointer-to-object type
/home/icecube/zodiac2/src/permute.cpp:50: error: pointer of type 'void *' used in arithmetic
/home/icecube/zodiac2/src/permute.cpp:50: error: 'void*' is not a pointer-to-object type
/home/icecube/zodiac2/src/permute.cpp:51: error: pointer of type 'void *' used in arithmetic
/home/icecube/zodiac2/src/permute.cpp:51: error: 'void*' is not a pointer-to-object type
gmake[2]: *** [permute.o] Error 1
gmake[2]: Target `all' not remade because of errors.