这是我在知乎回答的一个问题. 这个问题是C中的一个深坑,首先说结论: char ** 和 const char ** 是两个不相容(incompatible)的类型,能够理解为不能直接赋值 在C11的6.5.2.2 Function calls中有例如以下内容 Each argument shall have a type such that its value may be assigned to an object with the unqualified version of the ty…
部分内容摘自:https://blog.csdn.net/ranhui_xia/article/details/32696669 The version with const char * will copy data from a read-only location to a variable on the stack. The version with static const char * references the data in the read-only location (no…