include/utils.h
char *custom_strdup(const char *string)
{
    size_t string_len = strlen(string);
    char *duplicate   = (char *) malloc(string_len + 1);
    
    // Check if the duplicate pointer has been allocated 
    if(!duplicate)
    {
        return NULL;
    }

    /* 
        Returns the duplicate pointer with the same content/memory
        as the literary string passed as parameter 
    */
    return (char *) memcpy(duplicate, string, (string_len + 1));
}
/*
    This function is responsible for duplicating literal strings,
    in other implementations we use it to obtain the terms of the
    proposition, which we call token
*/
This function is responsible for duplicating literal strings,
in other implementations we use it to obtain the terms of the
proposition, which we call token
This function is responsible for duplicating literal strings in other implementations we use it to obtain the terms of the proposition which we call token
char *custom_strdup(const char *string)
{
    size_t string_len = strlen(string);
    char *duplicate   = (char *) malloc(string_len + 1);
    if(!duplicate)
    {
        return NULL;
    }
    return (char *) memcpy(duplicate, string, (string_len + 1));
}
char * custom_strdup ( const char * string ) { size_t string_len = strlen ( string ) ; char * duplicate = ( char * ) malloc ( string_len + 1 ) ; if ( ! duplicate ) { return NULL ; } return ( char * ) memcpy ( duplicate , string , ( string_len + 1 ) ) ; }
This function is responsible for duplicating literal strings,
in other implementations we use it to obtain the terms of the
proposition, which we call token
This function is responsible for duplicating literal strings in other implementations we use it to obtain the terms of the proposition which we call token
// Check if the duplicate pointer has been allocated  /* 
        Returns the duplicate pointer with the same content/memory
        as the literary string passed as parameter 
    */