Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有一种简单的方法可以在 C++ 中将 a 转换const char*为 a const char**(不使用 Boost)?我试过使用&myConstCharP,但没有奏效。
const char*
const char**
&myConstCharP
我在这里看不出问题。以下代码对我来说很好:
int main(int argc, char **argv) { char c = 'a'; const char *myConstCharP = &c; const char **p = &myConstCharP; printf("Your original char is: %c",**p); }