What you want is mathematically impossible, but maybe you're asking the wrong question. Perhaps you need 'a' to be a collection; that way it can have multiple values. Like so:
List<int> a = new List<int>(); |
a.Add(b); |
a.Add(c); |
a.Add(d); |
Or you can use a hashtable / dictionary to use a lookup by name:
int b, c, d; |
Dictionary<string, int> a = new Dictionary<string, int>(); |
a["b"] = b; |
a["c"] = c; |
a["d"] = d; |
Or maybe what you need is to access b, c and d through a in a type safe manner:
class A |
{ |
public int B { get; set; } |
public int C { get; set; } |
public int D { get; set; } |
} |
|
A a = new A { B = 1, C = 2, D = 3 }; |
|
// Now you can access b, c and d through a. |
int x = a.B + a.C + a.D; |
I hope this helps.