What does m_ represent?

  • Thread starter Thread starter clintonG
  • Start date Start date
C

clintonG

clintonG said:
A class? A method?
I need an explanation regarding which context this naming convention
may be used and any alternative representations please...

Usually it means "member". So, for instance you might have:

public class Test
{
string m_name

public Test (string name)
{
m_name = name;
}
}

It allows you to distinguish between local fields and member fields.
Personally I prefer to do that by keeping methods short enough to avoid
confusion in the first place.
 
m_ should be a prefix to help describe a variable as a
member. would have to see the code to know for sure.
 
Back
Top