【发布时间】:2016-05-20 10:48:49
【问题描述】:
我想创建一个以Int16 值为索引的数组,每个元素都是一个SByte。
如果这是可能的,我将如何构建我的陈述来实现这一目标? 这是我目前所拥有的。
//This saves the array size after creation for reference by other functions in the class
public static Int16 ArraySize = 0;
//input array size input by user from UI, min 0, max 1024
public static void InitArray(Int16 inputArraysize)
{
sbyte[] Arrayarray = new sbyte[inputArraysize];
Array.ArraySize = inputArraysize;
Debug.output("RAM ARRAY CREATED");
}
【问题讨论】:
-
你要的不是数组。
-
你能解释一下为什么你想改变.NET的数组索引类型吗?
-
我打算在某种程度上用数组来模拟 RAM;但是,我希望能够索引大于 127 的值,因此使用 16 位“地址总线”。
-
我明白了;你知道(在那种情况下)在那种情况下我如何将索引作为变量发送?我不能将
inputRAMsize作为sbyte传递,因为值明显受限。