const char* 类型不能用于初始化char* 类型实体
const char* 类型不能用于初始化char* 类型实体在学习C++ Primer PLus代码重用章节部分代码是出现以下错误char* Singer::pv[] = { "other","alto","contralto","soprano","brass","baritone","tenor" };解决办法:1、强制类型转换:char* Singer::pv[] = { (char*)"other",(char*)"alto",(char*)"contralto",(char*)"so
原创
2020-06-04 10:05:03 ·
1201 阅读 ·
1 评论