c# 重写 c++ 程序笔记:数据初始化

Fork Me On Github
zodream 编程技术 C++ 2022年05月

c# 重写 c++ 程序笔记:数据初始化

std::uint32_t 初始化

c++ 数组定义

c++
 
std::array<std::uint32_t, 7> data;
1

转成c# 数组

c#
        

var data = new uint[7];

for (int i = 0; i < 7; i++)
{
    data[i] = 0xcccccccc;
}
12345678

std::uint8_t 初始化

c++ 数组定义

c++
 
std::array<std::uint8_t, 7> data;
1

转成c# 数组

c#
        

var data = new byte[7];

for (int i = 0; i < 7; i++)
{
    data[i] = 0xcc;
}
12345678
点击查看全文
0 80 0