摘要: 字符数组转化成string类型char ch [] = "ABCDEFG";string str(ch);//也可string str = ch;或者char ch [] = "ABCDEFG";string str;str = ch;//在原有基础上添加可以用str += ch;将string类型 阅读全文
posted @ 2017-02-06 10:01 Boblim 阅读(144660) 评论(0) 推荐(13) 编辑
摘要: 1)是用Vector容器代替数组 2)使用数组指针(需要注意局部变量的问题,指针是否需要用new创建) int red [ 3 ] = { 1 , 0 , 0 }; int green [ 3 ] = { 0 , 1 , 0 }; int blue [ 3 ] = { 0 ,&# 阅读全文
posted @ 2017-02-06 10:00 Boblim 阅读(15543) 评论(0) 推荐(1) 编辑