c++ - '从 some_type** 到 const some_type** 的无效转换'

标签 c++ c gcc compiler-errors

我有一个函数需要 const some_type** 作为参数(some_type 是一个结构,函数需要一个指向这种类型数组的指针).我声明了一个 some_type* 类型的局部变量,并对其进行了初始化。然后我将该函数称为 f(&some_array),编译器 (gcc) 说:

error: invalid conversion from ‘some_type**’ to ‘const some_type**’

这里有什么问题?为什么我不能将变量转换为常量?

最佳答案

关于c++ - '从 some_type** 到 const some_type** 的无效转换',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2673495/

相关文章:

c++ - C++中指针的奇怪行为

c - 如何在gdb中查看二维数组特定索引的元素?

c - 我怎样才能写正确的代码行 *(node_pointer)->n

c++ - 链接上 undefined symbol ___gxx_personality_v0

c++ - 类型 T 的构造函数

使用类成员的 C++ 回调

c - 为什么我的for循环不遍历我的char_array?

c - 为什么 gcc 说我有未声明的变量 'newNode'?

c - 错误 13 : Invalid or unsupported executable while booting simple kernel in grub with string literal

c++ - 如何在 C++ 中不使用 pow 进行基础计算?