I would like to make sure that this method call is correct. I have three arguments, and one defaults to a null QString.
double funcApply(double* param, QString expr=NULL);
and the call is
funcApply(param);
In function body, I test whether second argument expr is NULL or not, and proceed accrodingly. Will this call behave as expected, or misbehave?
Thanks and regards.
It depends on what you expect it to behave like.
Technically,
exprwill not beNULLsince it’s not a pointer, but its contents will be empty. (assuming you mean QString).Of course, if you have something like
#define QString char*, thenexprwill beNULL, but I doubt you have that.