Can I make the name of a new object variable in c#?

后端 未结 4 1482
一个人的身影
一个人的身影 2021-01-23 05:23

For example:

car Audi = new car();

Is it possible to something like this:

string name = Microsoft.VisualBasic.Interaction.Input         


        
4条回答
  •  滥情空心
    2021-01-23 06:12

    This isn't possible as variable names are converted to addresses in memory whenever you compile the program.

    Since you're trying to name the variable after you compiled the program during runtime, it wouldn't make a difference since it's no longer a human readable name.

提交回复
热议问题