I did some search but my problem seems to be trivial so that no one asked.
I have a mixed c and c++ code.
In model.h, I have the following declaration:
void free_and_null (char **ptr);
Run Code Online (Sandbox Code Playgroud)
In model.cpp, I have the function body:
void free_and_null (char **ptr)
{
if ( *ptr != NULL ) {
free (*ptr);
*ptr = NULL;
}
} /* END free_and_null */
Run Code Online (Sandbox Code Playgroud)
In a solve.c file, I have the following :
#include "sort.h"
.....
free_and_null …Run Code Online (Sandbox Code Playgroud)