C#中有C++中memset(a,2,4);a数组,这样这种值的函数吗
不需要,C#会自动对数组清零。如果你需要设置别的值,可以用int[] data = Enumerable.Repeat(初始值, 数组长度).ToArray();