>extern char* delete_space_from_string ( char *string /* I */ )
extern is redundant. All function declarations are extern in C by default.
>if ( string == NULL || *string == NULL )
NULL should only be used in pointer context:
if ( string == NULL || *string == '\0' )
>free(temp_result);
This is effectively a no-op at all times. If you get here then temp_result is NULL. Otherwise, it would be a ghastly error because the function has no way of knowing whether string was dynamically allocated.
You also neglect to show strip_ending_whitespace, but its very presence strikes home the fact that your solution is bloated and overkill for such a simple operation. As an exercise in the use of strtok and sprintf, it's okay, but as a real solution to the problem of stripping whitespace, you can do much better.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401