I have a char* array which gets converted to void*, but I am having difficulty accessing the original array. See the args array:
void run_async(char* src, char* dest) {
char* args[] = {src, dest};
_beginthreadex(NULL, 0, copyFile, args, NULL, 0);
}
unsigned __stdcall copyFile(void* args) {
char* src = (char*)((char*)args)[0]; //!Not correct
}
My mind is having trouble wrapping around these pointers. How do I access array location 0 and 1 in the copyFile() function?
Edit: On coderpad the function works with the updated cast (char**) but during program execution with threadding it does not