【发布时间】:2021-12-20 20:50:46
【问题描述】:
我需要一些帮助来解决我在 Visual Studio 中收到的 C# 错误。他们声明不能将字符串转换为 int 或不能将 int 转换为 char。请问有人可以帮助我吗?
Console.WriteLine(" The largest value in the array is ", numberArray, maximumIndex, "located at array index" + maximumIndex);
//Loop through the two arrays and print the integer from integer array followed by the corresponding value from the string array
Console.WriteLine(" The numbers were: ");
for (int i = 0; i < numberArray.Length; i++)
Console.WriteLine(numberArray[i], " is ", stringArray[i]); **Getting error for "numberArray"-Cannot convert 'int' to 'char; Getting error for "is"-Cannot convert string to int; Getting error for "stringArray"-Cannot convert string to int**
【问题讨论】:
-
在这些写行中使用 + 而不是逗号