相关疑难解决方法(0)

用"new"创建2D数组?

我想创建一个如下所示的2D数组.

char **dog = new char[480][640];
Run Code Online (Sandbox Code Playgroud)

但它错误:

error C2440: 'initializing' : cannot convert from 'char (*)[640]' to 'char ** '
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Run Code Online (Sandbox Code Playgroud)

使用"新"我需要做什么?(不使用calloc,malloc或char dog[480][640];)

c++

2
推荐指数
2
解决办法
2万
查看次数

标签 统计

c++ ×1