warning:deprecated conversion from string constant to 'char *' 这样写会有warning,因为后面的程序有潜在的风险去修改str char* str="Hello"; 好的习惯应该是写成这个样子: const char* str="Hello";