It's usually to see a
_var variable name in a class field. What does the underscore mean? Thanks
_var variable name in a class field. What does the underscore mean? Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Himanshu PandyaPosted Jul 7, 2014, 2:11 AM
VulpesPosted Jul 5, 2014, 9:32 AM
private string _name;
public string Name
{
get { return _name;}
set { _name = value; }
}
This is just a convention and you don't have to follow it if you're allergic to underscores.
One thing you shouldn't do is to precede your identifiers with a double underscore as this is reserved for use by the system. For example __arglist is an undocumented C# keyword which is used for calling C functions which take a variable number of arguments.
Mahesh ChandPosted Jul 5, 2014, 8:47 AM