嗨,
在你的声明中,第一个''const''关键字告诉编译器指向的对象(你的字符串)是一个常量,而第二个''const''关键字告诉指针本身是一个常量(即它的值将是从不改变)。
根据你实际上要做的事情,第二个''const''可能是无用/错误的。
问候,
卢卡(宇宙)
以上来自于谷歌翻译
以下为原文
Hi,
in your declaration, the first ''const'' keyword tells the compiler that the pointed object (your strings) is a constant, while the second ''const'' keyword tells that the pointer itself is a constants (ie, its value will never change).
Depending on what you are actually trying to do, the second ''const'' might be useless/wrong.
Regards,
Luca (Cosmic)
嗨,
在你的声明中,第一个''const''关键字告诉编译器指向的对象(你的字符串)是一个常量,而第二个''const''关键字告诉指针本身是一个常量(即它的值将是从不改变)。
根据你实际上要做的事情,第二个''const''可能是无用/错误的。
问候,
卢卡(宇宙)
以上来自于谷歌翻译
以下为原文
Hi,
in your declaration, the first ''const'' keyword tells the compiler that the pointed object (your strings) is a constant, while the second ''const'' keyword tells that the pointer itself is a constants (ie, its value will never change).
Depending on what you are actually trying to do, the second ''const'' might be useless/wrong.
Regards,
Luca (Cosmic)
举报