Originally Posted by
Salem
> I know the function listhpath returns a Node
You could have fooled me.
Here.
pathDirs = listpath(&pathCopy);
Is this better?
OMG! YOU ARE THE BEST THANK YOU!
To whom it may concern:
I just changed a little bit the main.c code, here's the final version of it:
Code:
int main()
{
Node *head = NULL;
Node *pathDirs = head;
char *pathCopy = NULL;
pathDirs = listpath(&pathCopy);
while (pathDirs != NULL)
{
printf("\n %s\n", pathDirs->str);
pathDirs = pathDirs->next;
}
return (0);
}
Then I typed the following compiling command:
Code:
gcc -Wall -Werror -Wextra -pedantic -std=gnu99 *.c -o printf_path
And here's the final output after executing the printf_path program :
Code:
root@691c473c3479:/printf_path# ./printf_path
/bin
/sbin
/usr/bin
/usr/sbin
/usr/local/bin
/usr/local/sbin
Once more, thanks for the assistance. This thread can be closed now.