kir*_*off 0 c++ arrays qt types list
我想将一个float**参数列表传递给一些float**只使用C-syle的方法(但我们认为我们可以使用QList<>as参数类型).
我试过了
QList< float** > list_ = new QList< float** >();
Run Code Online (Sandbox Code Playgroud)
但这不起作用.我应该用什么呢?对于二维矩阵列表,Qt容器会是什么?
谢谢
您正在使用类似Java的语法(或c#或其他)
在C++中它应该是
QList<float**> *list_ = new QList<float**>() ; //Pointer to a heap allocated list, Closer to what you wanted to do i think. NEED TO CALL "delete list_" once you are done with it.
Run Code Online (Sandbox Code Playgroud)
要么
QList<float**> list_; //List on the stack, more c++ish, destroyed once it goes out of scope.
Run Code Online (Sandbox Code Playgroud)