Four front pockets, two outside and two interior that offers ample space for storing small accessories such as mobile phone, iPod, wallet and keys. Li...
分类:
其他好文 时间:
2014-07-16 22:57:33
阅读次数:
180
It's not the same. The const modifier can be applied to the value, or the pointer to the value.int * constA constant pointer (not modifiable) to an in...
分类:
其他好文 时间:
2014-07-12 09:04:56
阅读次数:
175
Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-nega...
分类:
其他好文 时间:
2014-07-12 00:15:07
阅读次数:
268
Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100"class Solution {public: string addBinary(stri...
分类:
其他好文 时间:
2014-07-11 20:05:47
阅读次数:
224
Java重载:
在同一个类中方法具有相同的名字,相同或不同的返回值,但参数不同的多个方法(参数个数或参数类型)
public class MethoDemo{
public static void main(String args[]){
int one = add(10,20) ; // 调用整型的加法操作
float two = add(10.3f,13.3f) ;...
分类:
编程语言 时间:
2014-07-10 20:08:16
阅读次数:
265
LINUX环境下多线程编程肯定会遇到需要条件变量的情况,此时必然要使用pthread_cond_wait()函数。但这个函数的执行过程比较难于理解。
pthread_cond_wait()的工作流程如下(以MAN中的EXAMPLE为例):
Consider two shared variables x and y, protected by the mutex mut,...
分类:
其他好文 时间:
2014-07-10 19:50:36
阅读次数:
347
经验:当std::swap对你的类型效率不高时,提供一个swap成员函数,并确定这个函数不抛出异常
示例:
stl里的swap算法
namespace std{
template
void swap(T &a, T &b){
T temp(a);
a = b;
b = temp;
}
}
//“pimpl手法”(pointer to implementation) --> 文件间的编译依存度
class WidgetImpl{
public:
//...
pr...
分类:
编程语言 时间:
2014-07-10 19:35:50
阅读次数:
240
C语言char s[] 和 char *s的区别,下面这个回答讲解的很清晰。
The difference here is that
char *s = "Hello world";
will place Hello world in the read-only parts of the memory and making s a pointer to that,...
分类:
编程语言 时间:
2014-07-10 17:23:56
阅读次数:
267
题目:Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or eq...
分类:
其他好文 时间:
2014-07-10 14:41:23
阅读次数:
177
Power Strings
Time Limit: 3000MS
Memory Limit: 65536K
Total Submissions: 31111
Accepted: 12982
Description
Given two strings a and b we define a*b to be their concate...
分类:
其他好文 时间:
2014-07-09 11:11:53
阅读次数:
155