Ein kleine grundlegende Sache die ich nicht ganz verstehe:
Code:
public static string operator +(string msg_a, string msg_b)
{
List<char> a_list = new List<char>();
foreach (char a in msg_a)
{
a_list.Add(a);
}
List<char> b_list = new List<char>();
foreach (char b in msg_b)
{
b_list.Add(b);
}
string ausgabe = null;
for (int i = 0; i <= b_list.Count; i++)
{
ausgabe += b_list[i].ToString() + a_list[i].ToString();
}
return ausgabe;
}
}
der code ist nur als beispielcode gedacht.
Fehler:
Error 1 One of the parameters of a binary operator must be the containing type
Hoffe das liest bis morgen jemand!
Danke!