Quote (AbDuCt @ Apr 2 2013 01:15am)
what is not working about it?
try using printf() with the %p flag and supply your pointer->parent (casted as (void*) for %p) and then also print the child node or w/e idk.
but anyways print the addresses that you are changing before and after and see what they are being set to is what im trying to get at.
Yea I printed the statements, files->name prints the correct name of the current node, it just doesn't seem to change *files to that position when it exits the function
The return type of the functions an int, but that shouldn't really matter, files should still now point at sub_dir
Code
sub_dir = files->sub_dir;
while(sub_dir != NULL){
printf("in");
if(strcmp(sub_dir->dir_name, arg) == 0){
printf("in 2");
files = sub_dir;
printf("%s", files->name);
return 0;
}
printf("out");
sub_dir = sub_dir->next;
}
This post was edited by lopelurag on Apr 1 2013 11:22pm