编译时收到警告

时间:2015-04-18 20:17:00

标签: c++

 #include <iostream>
 #include "sort.h"

 int main() {
 int a[] = {1234, 546, 786, 2341};
 char* c[6] = {"Harry", "Jane", "Anne", "John"};

 sort(a, 4);
 sort(c, 4);

 for (int i = 0; i < 4; i++)
     std::cout << a[i] << std::endl;
 std::cout << std::endl;

 for (int i = 0; i < 4; i++)
     std::cout << c[i] << std::endl;
 std::cout << std::endl;
 }

编译时我收到的警告是不推荐从字符串文字到char *的转换。 如何弄清楚??

0 个答案:

没有答案