1:MyString.h
#pragma once
class myCString
{
public:
int GetLength()const {return m_nLength;}
myCString(void);//无参构造函数
myCString(const char* p);//根据字符串常量初始化
myCString(const myCString& rhs...
分类:
其他好文 时间:
2014-12-01 10:14:51
阅读次数:
206
一、编译器为空类生成函数的原型以及函数创建的时机
在C++中当创建一个空类时,C++就会默认的为这个类创建4个函数:默认的构造函数、析构函数、拷贝构造函数、以及赋值操作符。
C++中创建一个空类:
class Empty {};
默认会生成4个函数,其函数的原型如下:
public: Empty() { ... } Empty(const Empty& rhs) {...
分类:
编程语言 时间:
2014-11-27 12:44:45
阅读次数:
240
示例如下:class MyClass{public: MyClass(int a) : _a(a) { } MyClass(const MyClass& rhs){ new(this)MyClass(rhs._a); // placement new } MyClass & operator = (...
分类:
其他好文 时间:
2014-10-25 22:51:21
阅读次数:
180
class _string{public: _string(const char* str=NULL); _string(const _string& another); ~_string(); _string& operator=(const _string & rhs);...
分类:
其他好文 时间:
2014-10-21 16:54:27
阅读次数:
205
less主要是重载了operator()方法,用来比较lhs 和 rhsstd::less::operator()bool operator()(const T &lhs, const T &rhs) const;constexpr bool operator()(const T &lhs, con...
分类:
其他好文 时间:
2014-10-11 15:23:25
阅读次数:
122
private Map mapDate;//正序mapDate=new TreeMap(new Comparator() { @Override public int compare(String lhs, String rhs) { ...
分类:
编程语言 时间:
2014-09-23 14:30:14
阅读次数:
134
修改/etc/inittab 将“id:5:initdefault:”修改为“id:3:initdefault:”,具体参数可以参见该文件中的注释部分 # Default runlevel. The runlevels used by RHS are: # 0 - halt (Do NOT set ...
Method1: map :windo exe "normal \C-W>K"
Method2: map :windo wincmd K
Method3: map :call HorizontAll()
function! HorizontAll()
windo exe "normal \K"
endfunction
小结:
1 map {rhs} 的字串中,ctrl...
分类:
其他好文 时间:
2014-09-04 09:43:37
阅读次数:
158
题目链接题意:给出一些数a[n],求(i, j),i f(j, n, a[j])。f(lhs, rhs, x)指在{ [lhs, rhs]范围中,a[k]的值=x }的数量。1.f(1, i, a[i])就是指a[i]前面包括a[i]的数中,有几个值=a[i]。2.f(j, n, a[j])就是指a...
分类:
其他好文 时间:
2014-08-16 19:46:50
阅读次数:
271
启动的配置文件/etc/inittab,修改完配置文件以后 init q立即生效# Default runlevel. The runlevels used by RHS are:# 0 - halt (Do NOT set initdefault to this)# 1 - Single ...
分类:
系统相关 时间:
2014-08-10 18:26:10
阅读次数:
256