Hi I have seen this before but I am confused as to why people do so. If there is a technical term to better define it please do let me know
If you look at the code below
Code:
there are terms like "class Correl" and "typdef _Correl"Code:class _Correl { public: double Nom; double DeNom1, DeNom2; _Correl( double val ) { Nom = DeNom1 = DeNom2 = val; } void operator=( double val ) { Nom = DeNom1 = DeNom2 = val; } operator double() { return Nom / sqrt( DeNom1 * DeNom2 ); } }; class Correl { public: typedef _Correl result_type; Correl() { mean1 = mean2 = 0; } Correl( double _mean1, double _mean2 = 0 ) { mean1 = _mean1; mean2 = _mean2; } template<class Val> result_type operator () ( result_type s, Val val1, Val val2 ) { double v1 = val1 - mean1; double v2 = val2 - mean2; s.Nom += v1 * v2; s.DeNom1 += v1 * v1; s.DeNom2 += v2 * v2; return s; } protected: double mean1; double mean2; };
"mean1 = _mean1" "double _mean1"
Now I do understand that mean1 and _mean1 are different
but why do codders (at higher level) use "_name of (variable/function etc.).
I have seen this in header files of VC++ as well?
If there is some documentation that I could refer on this matter I would like to know.
Thanks
Nipun



LinkBack URL
About LinkBacks


