小编Luk*_*sas的帖子

结构中的默认值(char)

我想请求帮助.当我得到这个:

struct MyStruct
{
    unsigned char myBytes[5];
    MyStruct()
    {
        myBytes[0] = 0x89;
        myBytes[1] =  0x50;
        myBytes[2] =  0x4E;
        myBytes[3] =  0x47;
        myBytes[4] =  0x0D;
    }        
};
Run Code Online (Sandbox Code Playgroud)

如何让它变得简单?比如myBytes = {0x89,0x50,0x4E,0x47,0x0D};

c++ struct char assign

1
推荐指数
1
解决办法
270
查看次数

标签 统计

assign ×1

c++ ×1

char ×1

struct ×1