传参方法
## 函数
extern void f2 ( const char ** ccc );
const char ch = 'X';
char * ch_ptr;
const char ** ch_pptr = &ch_ptr; // This is not allowed, because...
## 传参
f2(ch_ptr)
## 如果遇到报错
f2(const_cast<const char**>(ch_ptr));
参考
const char * vs. const char ** function argument [duplicate]
https://stackoverflow.com/questions/32096734/const-char-vs-const-char-function-argument
c++: why can‘t we convert char ** to const char ** [duplicate]
https://stackoverflow.com/questions/32779079/c-why-cant-we-convert-char-to-const-char
原文地址:https://www.cnblogs.com/17bdw/p/10353434.html
时间: 2024-10-27 06:47:27