Originally Posted by
matsp
I doubt you can do that. arg and backup point to the same bit of memory. You have no way to modify arg inside foo(), so you can't make it point to something else.
Maybe you have misunderstood the task?
--
Mats
Thanks for your reply - my actual code is this... but it is assumes to be do in this way....
Code:
static void* function(char* arg){
fprintf(stderr, "int 3h\n");
printf("You've made it passed the first obstacle!\n");
printf("-----\nStep 2. Case of the missing dynlib\n");
char* backup = strdup(arg);
void* handle = dlopen("mylib.so", RTLD_NOW);
voidfun hsym = dlsym(handle, "NULL");
hsym(arg);
if (strcmp(arg, backup) != 0) cake(arg);
}
Now i want to make this condition true , so cake function will parsed by compiler...
that method which i have described above is supposed to be done in the shared library which i have created....