自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(6)
  • 收藏
  • 关注

原创 C++字符串3——存取赋值

1.存取 reference operator[] (size_type pos); const_reference operator[] (size_type pos) const; reference at (size_type n); const_reference at (size_type n) const; basic_string substr(size_type pos =

2015-11-02 22:18:23 304

转载 对C++中string类型的总结

C++字符串总结

2015-11-02 22:12:55 240

原创 C++字符串2——字符串构造

string类的构造函数: 1、string(const char* s); 2、string(size_type n, char c); 3、string(const string & str); 4、string(); 5、string(const char * s , size_type n); 6、template string(I

2015-10-31 23:17:27 535

原创 C++字符串1

一、C风格字符串 简略介绍一下,c风格字符串存储在字符串数组中,特别注意最后一个元素为空字符,否则就成了char类型的数组了。 字符串输入用cin,但是字符串中存在空格的时候就有缺陷。因此,使用istream类中的成员函数getlin()和get(); 1.getline()函数: getline()函数每次读取一行,它通过换行符来确定

2015-10-27 22:26:13 305

原创 运算符重载

一、操作符重载 用复数来实例:#include <iostream>using namespace std;class Complex {public: Complex (int r = 0, int i = 0) :m_r (r), m_i (i) {} Complex const operator+ (Complex const& rhs) const {

2015-10-26 23:38:11 233

转载 c++重载<, +, +=, =, ==, <<, >>等符号

以下示例中定义了一个class test,重载了>等符号:#include#includeusing namespace std;class test{public:    int v;      test():v(0){}    test(const int &a):v(a){}    test(const test &t1):v(t1.v){}

2015-10-25 22:39:18 447

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除