学习C++复合数据类型
String 类型
char str[20]; //strlen(str)的长度不一定是20
cin.getline(str,20); //读入一行输入(cin是iostream类的一个对象,getline()是iostream类的一个类方法)
使用R来标识原始字符串
cout<<R"(Tom is handsome,\n"this is wrong".)"<<'\n';
//运行结果:Tom is handsome,\n"this is wrong".
C++结构体
#
原创
2020-12-30 17:24:54 ·
252 阅读 ·
0 评论