Hi guys,
When I compile this code, I'm getting the following error:
warning: implicit declaration of function 'strdup'
I've included <string.h> and <wchar.h> so I shouldn't be getting the error right?
The line of code in question is:
Code:
//some declarations inside a static function
simple_path = strdup(path);
Any help is appreciated.
Thanks
EDIT: Here's a entire function until the point of the error:
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <wchar.h>
/* some other functions*/
static Item * parse(Item * const root, Item * const curr, char * path)
{
char *simple_path;
char *a, *b;
char temp[80] = {0};
Item * true_item = NULL;
int finished = 0;
simple_path = strdup(path); //error here
//blah blah