gpt4 book ai didi

c# - 对象数组未按预期交付

转载 作者:太空宇宙 更新时间:2023-11-03 18:20:23 24 4
gpt4 key购买 nike

<分区>

using System;
namespace TestArr
{
class Indix
{
public string i0 = null;
public string x0 = null;
public Indix(string i1, string x1)
{
i0 = i1;
x0 = x1;
}
}
class mainex
{
public mainex()
{
Indix[] m = new Indix[3];
m[0] = new Indix("this", "isit");
m[1] = new Indix("What", "For");
m[2] = new Indix("for", "it");
foreach (Indix v in m)
{
Console.WriteLine(v.ToString());
}
Console.ReadKey();
}
static void Main()
{
mainex h = new mainex();
}
}
}

输出是:output from console

但我想要这个输出:

this isit

What For

for it

那么我做错了什么以及以后要考虑什么?

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com