1. map的erase函数使用
这里首先要注意,C++针对map的erase函数有不同的函数原型,这往往是出现问题的关键所在。根据参考文献1: 在C++98中:(1) void erase
(iterator position);(2)size_type erase (const key_type...
分类:
其他好文 时间:
2014-05-26 23:52:50
阅读次数:
412
1,项目属性选择Unicode;2,添加#include
;3,所有的""转换成_T("");4,看具体代码:for( std::vector::iterator
iterator=service.m_tDeviceList.begin(); iterator!=serv...
分类:
其他好文 时间:
2014-05-26 23:41:29
阅读次数:
522
代码1[cpp]view
plaincopy#include#includeclassA{public:A(){printf("A()/n");}~A(){printf("~A()/n");}A(constA&other){printf("other/n");}};intmain(){Aa;Ab(....
分类:
其他好文 时间:
2014-05-26 22:18:50
阅读次数:
382
在数据库表中,使用索引可以大大提高查询速度。All storage engines
support at least 16 indexes per table and a total index length of at least 256
bytes. Most storage engines h...
分类:
数据库 时间:
2014-05-26 21:23:17
阅读次数:
349
此文介绍 ubuntu 平台下配置 AMD/ATI Opencl 环境,我是ubuntu
12.04。主要分为六个步骤:1. Take a look at your hardware to make sure it’s compatible
先安装驱动,http://support.amd.com....
分类:
其他好文 时间:
2014-05-26 15:51:53
阅读次数:
384
集合类说明及区别Collection├List│├LinkedList│├ArrayList│└Vector│ └Stack└SetMap├Hashtable├HashMap└WeakHashMapCollection接口
Collection是最基本的集合接口,一个Collection代表一组O....
分类:
编程语言 时间:
2014-05-26 09:32:53
阅读次数:
258
PECL :: Package :: memcache 2.1.1 版本的 Changelog
中有一条:- Added experimental session storage support. You can use memcached as
session storage.也就是可以直接用 m...
分类:
Web程序 时间:
2014-05-26 08:51:55
阅读次数:
322
#include#include#include#include#includeusing
namespace std; vector > ret;vector sub;int num = 0;void helper(int* str, int
n,int i) ///递归求组合{ if(i ==....
分类:
其他好文 时间:
2014-05-23 06:42:21
阅读次数:
232
【题目】
Implement wildcard pattern matching with support for '?' and '*'.
'?' Matches any single character.
'*' Matches any sequence of characters (including the empty sequence).
The matching should cover the entire input string (not partial).
The functi...
分类:
其他好文 时间:
2014-05-23 00:17:12
阅读次数:
364
这几个题很典型也是国外一些知名公司经常会问到的题
3Sum:
排序,避免重复,时间复杂度O(n^2)
class Solution {
public:
vector > threeSum(vector &num) {
int len=num.size();
sort(num.begin(),num.begin()+len);...
分类:
其他好文 时间:
2014-05-22 17:25:02
阅读次数:
259