How to specify fixed size buffer in C ++ / CLI?

In C #, I can specify a fixed size using a keyword fixed, for example:

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

How can I express the same in C ++ / CLI?

+5
source share
3 answers

In one of the C ++ / CLI developers' blogs, a code appeared to solve the template, I will try to find the link.

Ah, found it. He is called inline_array.

+8
source

C # syntax has been added as a way to express C ++ syntax that you know forever. :)

public:
    wchar_t FixedBuffer[128];
+1
source

:

128 char 256 . char .

, :

struct StructWithFixedBuffer
{
    char FixedBuffer[128*2];
};
+1

All Articles