char *與const char **函數參數傳參問題
阿新 • • 發佈:2019-02-06
函數參數 http quest stack cast ... 參數 code -c
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
傳參方法
## 函數
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]
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
char *與const char **函數參數傳參問題