also kann man ne string variable als auswahl benutzen?
so in etwa funktioniert es schonmal nicht;)
C#-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23:
| string auswahl;
Console.Write("triff deine auswahl 1,2,a oder b: "); auswahl = Console.ReadLine();
switch (auswahl) { case (1): Console.Write("1"); Console.Read(); break; case (2): Console.Write("2"); Console.Read(); break; case (a): Console.Write("a"); Console.Read(); break; case (b): Console.Write("b"); Console.Read(); break; |
edit: wollte noch sagen das ich schon bei "msdn.microsoft.com", "http://openbook.galileocomputing.de/visual_csharp/" und nochmal beim Index von c# nachgeschaut, aber nicht darüber gefunden><