如何在C ++ / CLI中指定固定大小的缓冲区? [英] How do I specify a fixed-size buffer in C++/CLI?

查看:166
本文介绍了如何在C ++ / CLI中指定固定大小的缓冲区?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在C#中,我可以使用固定大小的缓冲区 > fixed 关键字,如下所示:

In C#, I can specify a fixed sized buffer using the fixed keyword, like so:

public unsafe struct StructWithFixedBuffer
{
    public fixed char FixedBuffer[128];
}

我如何在C ++ / CLI中表达同样的东西?

how would I express the same thing in C++/CLI?

推荐答案

C ++ / CLI开发人员博客中有一个模板解决方案的代码,我会尝试找到一个链接。

One of the C++/CLI developer blogs had code for a template solution to this, I'll try to find a link.

找到了。它被称为 inline_array

这篇关于如何在C ++ / CLI中指定固定大小的缓冲区?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆