瑞星卡卡安全论坛技术交流区系统软件 c#初级入门问答(第一个答对有奖啊)

123   1  /  3  页   跳转

c#初级入门问答(第一个答对有奖啊)

c#初级入门问答(第一个答对有奖啊)

// arrays.cs
using System;
class DeclareArraysSample
{
    public static void Main()
    {
        // Single-dimensional array
        int[] numbers = new int[5];

        // Multidimensional array
        string[,] names = new string[5,4];

        // Array-of-arrays (jagged array)
        byte[][] scores = new byte[5][];

        // Create the jagged array
        for (int i = 0; i < scores.Length; i++)
        {
            scores = new byte[i+3];
        }

    }

请问此时scores[4]=??
最后编辑2006-02-15 22:34:35
分享到:
gototop
 

题目有问题把.怎么可能把一个一维数组的数据,给一个二维数组呢?
gototop
 

对了!问斑竹个事啊!我一个朋友刚去北京的华为工资4000(有项目奖金和年终奖金)行么!现在瑞星的基本研发人员的基本工资多少?
gototop
 

我不清楚瑞星公司研发人员的工资,不过江民公司的高级软件工程师的月薪是2万左右吧。
gototop
 

for (int i = 0; i < scores.Length; i++)
{
scores = new byte[i+3];
}

你这段代码要表示什么意思?byte类型我没有见过;
gototop
 

引用:
【江波的贴子】题目有问题把.怎么可能把一个一维数组的数据,给一个二维数组呢?
...........................


题目肯定没问题!呵呵
gototop
 

【回复“tonnyblue”的帖子】
据我所知,华为最低的工资应该不低于5K的!至于项目奖金和年终奖金嘛,应该大部分的公司都有吧!
gototop
 

【回复“江波”的帖子】
你试着运行一下这段代码?
// Single-dimensional array
int[] numbers = new int[5];

// Multidimensional array
string[,] names = new string[5,4];

// Array-of-arrays (jagged array)
byte[][] scores = new byte[5][];

// Create the jagged array
for (int i = 0; i < scores.Length; i++)
{
scores = new byte[i+3];
}

// Print length of each row
for (int i = 0; i < scores.Length; i++)
{
Console.WriteLine("Length of row {0} is {1}", i, scores.Length);

}
gototop
 

我运行时候报错呀!

无法将G:\My Documents\Visual Studio Projects\ConsoleApplication1\Class1.cs(24): 无法将类型“byte[]”隐式转换为“byte[][]”
gototop
 

我也拿来运行一下啊
gototop
 
123   1  /  3  页   跳转
页面顶部
Powered by Discuz!NT