I\'m using a macro and I think it works fine -
#define CStrNullLastNL(str) {char* nl=strrchr(str,\'\\n\'); if(nl){*nl=0;}}
So it works to zero out the last
to return value from macro:
bool my_function(int a) { if (a > 100)return true; return false; } bool val = my_function(200); #define my_macro(ret_val,a){\ if(a > 100 ) ret_val = true;\ ret_val = false;\ } bool val; my_macro(val, 200);