function - Cannot understand a C++ line -


i reading c++ code , came across function:

double nm_poissons_ratio(double /*temp*/)  {    double pr(0.0);    pr = 0.31;    return pr;  } 

i don't understand effect of /* */ characters surround temp variable.

thanks

if write

double nm_poissons_ratio(double temp) 

the compiler warning. unused variable.

in case, coder wanted retain signature reason, avoid warning. he/she therefore put comment show was.


why signature? it's hard know.

  • perhaps intermediate version of code, , he/she plans use parameter in future (this excellent case retain warning).

  • perhaps it's passed callback function expects specific signature.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -