![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
随笔总结
Apink233
这个作者很懒,什么都没留下…
展开
-
C++中使用stringstream简化类型转换
C++标准库中的<sstream>提供了一个stringstream,以前基本没用过,突然发现很好用(^-^)V 参见 http://www.cplusplus.com/reference/sstream/stringstream/ 如果你打算在多次转换中使用同一个stringstream对象,记住再每次转换前要使用clear()方法; 在多次转换中重复使用同一个stringst...转载 2018-07-22 09:57:44 · 87 阅读 · 0 评论 -
c/c++中sizeof()、strlen()、length()、size()详解和区别
c/c++中获取字符串长度。有以下函数:size()、sizeof() 、strlen()、str.length();一、数组或字符串的长度:sizeof()、strlen() 1、sizeof():返回所占总空间的字节数 (1)、对于整型字符型数组 (2)、对于整型或字符型指针 2、strlen():返回字符数组或字符串所占的字节数 (1)、针对字符数组 (2)、针对字符指针 sizeof(.....转载 2018-07-22 09:58:37 · 174 阅读 · 0 评论 -
delete p和delete[] p的区别
#include<bits/stdc++.h> using namespace std; class T { public: T() { cout << "constructor" << endl; } ~T() { cout << "destructor" << endl; } }; int原创 2018-11-12 14:38:17 · 506 阅读 · 0 评论