#include <iostream> #include <string> //
使用 string
时添加的 using namespace std; int main() { char ctr[]=”I am happy”;//
字符数组存放 string str=”I love china”;//
字符串变量存放 char * p=”I want to travele with you!”;//
字符指针存放 cout<<ctr<<endl; cout<<str<<endl; cout<<p<<endl; return 0;
}
本文转自 韬光星夜 51CTO博客,原文链接:http://blog.51cto.com/xfqxj/477111,如需转载请自行联系原作者