Dynamically Creating Variables in C#



Is there any way to dynamically creat variables?

In other words, I want to be able to do something like that:

for(int i=0; i<size; i++){

string temp+i = i*3;

}

I want my variables to be temp0, temp1, temp2, etc.

.



Relevant Pages

  • Re: Dynamically Creating Variables in C#
    ... Is there any way to dynamically creat variables? ... I want my variables to be temp0, temp1, temp2, etc. ... but you can use an array instead: ... int size = 10; ...
    (comp.programming)
  • Dynamically Creating Variables
    ... Is there any way to dynamically creat variables? ... I want my variables to be temp0, temp1, temp2, etc. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Dynamically Creating Variables
    ... ann wrote: ... I want my variables to be temp0, temp1, temp2, etc. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Dynamically Creating Variables in C#
    ... I want my variables to be temp0, temp1, temp2, etc. ... How would you know how to access them at compile time then? ...
    (comp.programming)