I have defined an assert function, just to print the function name and line number, but I get Segmentation fault (core dumped), how to fix it?
#define assert( string ) \
printf("%s - %s assert %s\n",__FUNCTION__, __LINE__, #string);
int main(int argc, char **argv)
{
assert( "test assert" );
printf("%s(%d)-%s: this is main\n",__FILE__,__LINE__,__FUNCTION__);
return 0;
}
the ultimate target is to define the function to print all the info passed by parameter like printf
receive unlimited parameters.