zodream梦想开源/个人编程日记

zodream梦想开源/个人编程日记

简单的个人编程日记

马上订阅 zodream梦想开源/个人编程日记 RSS 更新: https://zodream.cn/blog/rss

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

2022年5月14日 18:54
编程技术

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

std::uint32_t 初始化

c++ 数组定义

std::array<std::uint32_t, 7> data;

转成c# 数组


var data = new uint[7];

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

std::uint8_t 初始化

c++ 数组定义

std::array<std::uint8_t, 7> data;

转成c# 数组


var data = new byte[7];

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