这两个是等价,不管是整体输出,或者是对某一项进行操作得到的结果是一样的!只是格式不同而已,第二种有点像二维数组初始化的感觉例如:
string sz[5][5]={ {"1","2 ","3,"4 ","5 "},
{" 1","2","3 ","4","5 " },
{" 1","2","3 ","4","5 " },
{" 1","2","3 ","4","5 " },
{" 1","2","3 ","4","5 " }}
从右表达式看,你的理解一点都不错;可是一个一维字符串数组与字符数组形成的串有区别吗?
char是字符数组,string才是字符串数组,你写的有问题吧?