C++ 中 char* 数组的初始化问题

发布网友

我来回答

2个回答

热心网友

char *str={"one","two","three","four","five"};等价char str[]={"one","two","three","four","five"};

热心网友

char *pNumbers = { "one", "two", "three", "four" };

cout << pNumbers[2]; // 输出 three

热心网友

char *str={"one","two","three","four","five"};等价char str[]={"one","two","three","four","five"};

热心网友

char *pNumbers = { "one", "two", "three", "four" };

cout << pNumbers[2]; // 输出 three

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com