為什么每次都提醒我了string[]長(zhǎng)度沒(méi)有被定義,這哪里錯(cuò)了!我好氣
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ?string[] names={"關(guān)羽","張飛","趙云","馬超","黃忠"};
? ? ? ? ? ?for(int i=0; i< names.length; i++)//請(qǐng)?jiān)谶@里完善代碼
? ? ? ? {
? ? ? ? ? ?Console.Write(names[i]);
? ? ? ? }
? ? ? ? }
? ? }
}
2020-06-16
string[] names=new string[]{"關(guān)羽","張飛","趙云","馬超","黃忠"};
你沒(méi)有new一個(gè)新數(shù)組
2019-07-11
我知道了length,L大寫(xiě)