c# - Finding the variable name passed to a function -


let me use following example explain question:

public string examplefunction(string variable) {     return something; }  string whatismyname = "hello world"'; string hello = examplefunction(whatismyname); 

when pass variable "whatismyname" example function, want able string of original variables name. perhaps like:

variable.originalname.tostring() 

is there way this?

**no.**i don't think so.

the variable name use convenience , readability. compiler doesn't need & chucks out if i'm not mistaken.

if helps, define new class called namedparameter attributes name , param. pass object around parameters.


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -