Just imagine this simple situation:
int temperature = 20;
is there any possibility to give a dynamic parameter name?? Like for example (I know that doesn’t work, just to get the idea) :
int Array[1].ToString() = 20;
Thank you!
Cheers Chris
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No. Not in C#. The closest you could get would be to use a
Dictionary<string, object>:But not only does that involve casting each time you need to retrieve the value, but it will also cause boxing/unboxing.
All told, I certainly wouldn’t recommend it.