C#相当于C ++ vector <int>

时间:2018-09-22 06:38:19

标签: c# arrays vector

这是c ++代码:

std::vector<int> T(256,-1);
for (int i=0; i<64; i++) T["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[i]] = i;

此代码的c#等效项是什么?

1 个答案:

答案 0 :(得分:2)

var T = Enumerable.Repeat(-1, 256).ToList();
for (int i = 0; i < 64; i++)
    T["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[i]] = i;