很难弄清楚 (uint8_t const * const *) 在 .Net 术语中的含义

Difficulty to figure out what (uint8_t const * const *) means in .Net terms

我正在阅读 C++ 代码,我正在努力理解这个转换:

(uint8_t const * const *) someVideoFrame->someData

我看到类似指向字节数组的指针,但我很难理解双重 constant pointer 用法。

据我所知,我只是将其移植为 (byte **)。

在步骤方面,这个演员试图达到什么目的? C++ 中的 const 效果是什么?

编辑

同时我在 C++ 文档中发现了这个:

int const * const Constant4

... declares that Constant4 is constant pointer to a constant integer. Basically ‘const’ applies to whatever is on its immediate left (other than if there is nothing there in which case it applies to whatever is its immediate right).

但我仍然想知道动态声明常量的 objective 是什么。

从右开始向左移动:pointer to const pointer to const uint8_t

   uint8_t const     * const           *
// ^^^^^^^^^^^^^     ^^^^^^^           ^
//               to               to
// const uint8_t <- const pointer <- pointer

如果你想学习更多关于阅读指针声明的知识,并且尽可能好,我强烈推荐learning the "spiral rule"。虽然老了,但我觉得超级好用,助记词真的好掌握

演员可能试图强制您没有错误地修改内部指针(即 const),也不是它指向的数据(也是 const)。