摘要: 一般情况下 char* string = "abc"; 编译后会出现标题中的错误。 我们只需要在字符串前加上const_cast<char*>即可,这个作用是丢弃变量的const声明,但不能改变变量所指向的对象的const属性。即:const_cast用于原本非const的对象;如果用于原本cons 阅读全文
posted @ 2020-02-28 16:34 strive-sun 阅读(3654) 评论(0) 推荐(0) 编辑