2016-12-02 24 views
0

「Sometype * const *」表示什麼?「Sometype * const *」表示什麼?

它是否等同於const SomeType *?

我在查找UE4中的TMap數據結構的查找鍵功能時碰到了它,並且第一次看到類似這樣的事情。

不用說,我也沒有什麼意義了出來,並首先想到可以存儲它

enter image description here

+3

它是一個指向常量指針(非常量)'Sometype'的指針。 –

+1

@Someprogrammerdude PointerCeption? – Allahjane

+0

https://isocpp.org/wiki/faq/const-correctness#const-ptr-vs-ptr-const – Ripi2

回答

3

讓我們拆開它的任何類型的,考慮一個更簡單,更熟悉的例子:

Sometype**是指向指向非對象的指針的指針。

Sometype* const*是指向const-指向非constSometype對象的指針。

+1

我明白了!因爲const sometype *是用於常量指針的 – Allahjane

相關問題