I am reading a C++ code and came across a function:
double Nm_poissons_ratio(double /*Temp*/) { double PR(0.0); PR = 0.31; return PR; } I don't understand what is the effect of /* */ characters which surround the Temp variable.
Thanks
I am reading a C++ code and came across a function:
double Nm_poissons_ratio(double /*Temp*/) { double PR(0.0); PR = 0.31; return PR; } I don't understand what is the effect of /* */ characters which surround the Temp variable.
Thanks
If you write
double Nm_poissons_ratio(double Temp) the compiler will warning. about an unused variable.
In this case, the coder wanted to retain the signature for some reason, but to avoid the warning. He/she therefore put a comment to show what it originally was.
Why is this the signature? It's hard to know.
Perhaps this is an intermediate version of the code, and he/she plans to use this parameter in the future (this is actually an excellent case to retain the warning).
Perhaps it's passed as a callback to some function that expects a specific signature.