It just means that it's a member varible...you don't have to use it if you don't want to. It's just there for readablility. At least, this is what I believe it means...someone correct me if I'm wrong.
Valius is correct. It is a member variable (meaning a variable within a class) A simple example of its use would be on a dialog based app. Through the use of the class wizard you can assign a member variable to a control on the dialog.
1. Create a new project
2. Make it a dialog based app
3. put an edit box on the dialog
4. right click the dialog and go to class wizard (i have noticed that you may need to build the project at least once before you see all the controls in the class wizard)
5. Select your control
6. Add a member variable of type cstring
7. Add a button and use the class wizard for on click
8. Edit the code to pop up a message box to display what is currently in the edit box
Through the use of UpdateData(TRUE/FALSE) you can fill the edit box with what is in the memeber variable or vice versa.
Yes, I've noticed "m_"s in variables for MFC classes, created with MFC class wizard, now, I'm working on a few non mfc classes, so I cannot use Class Wizard and I'm asking, coz I want to now, If I use m_ prefix correctly.
I really don't ever use the "m_" naming scheme...I used to when I used MFC...but I've gotten into the Win32 aspect of it and haven't used it. I've kinda come up with my own naming scheme but still using some of the conventional namings. Do what is most comfortable for you.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.