How do I name variables dynamically in C#?

前端 未结 9 2207
悲哀的现实
悲哀的现实 2020-11-27 06:30

Is there a way to dynamically name variables?

What I need to do is take a list of variable names from an input file and create variables with those names. Is this p

9条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-27 07:18

    No. You can load them into a Dictionary object, however. This allows you to still reference them (somewhat) using a name, which is a bit easier than using an Index, as you would with an Array or ArrayList.

提交回复
热议问题