码迷,mamicode.com
首页 >  
搜索关键字:std    ( 41627个结果
使用curl 下载HTML
简单的一个curl小例子:#include #include #include #include #include #define BUF_SIZE 1024 * 100using namespace std;string DownloadString(char* url);int main(int...
分类:Web程序   时间:2014-05-12 02:55:46    阅读次数:394
std::stringstream(1)
在编写应用程序时,我们经常要使用到字符串。C++标准库中的和为我们操作字符串提供了很多的方便,例如:对象封装、安全和自动的类型转换、直接拼接、不必担心越界等等。但今天我们并不想长篇累牍得去介绍这几个标准库提供的功能,而是分享一下stringstream.str()的一个有趣的现象。我们先来看一个例....
分类:其他好文   时间:2014-05-12 01:36:43    阅读次数:254
std::stringstream(2)
stringstream本身的复制构造函数是私有的,无法直接用,于是带来了一些复杂的问题网上,流传着几种办法,如streamA.str(streamB.str()),但这种办法,复制的仅仅是初始化时的string会在以下这种情况下暴露出问题: stringstream s1("123aaa")...
分类:其他好文   时间:2014-05-12 00:53:33    阅读次数:266
C++拷贝构造函数(深拷贝,浅拷贝)
对于普通类型的对象来说,它们之间的复制是很简单的,例如:int a=88;int b=a;而类对象与普通对象不同,类对象内部结构一般较为复杂,存在各种成员变量。下面看一个类对象拷贝的简单例子。 1 #include 2 using namespace std; 3 4 class CExampl.....
分类:编程语言   时间:2014-05-12 00:03:19    阅读次数:516
SPOJ 4487. Can you answer these queries VI splay
题目链接:点击打开链接 题意比较明显,不赘述。 删除时可以把i-1转到根,把i+1转到根下 则i点就在 根右子树 的左子树,且只有i这一个 点 #include #include #include #include using namespace std; #define N 300500 #define inf 10000000 #define L(x) tree[x].ch[0] #d...
分类:其他好文   时间:2014-05-11 21:05:52    阅读次数:365
HDU 4027 Can you answer these queries? 线段树裸题
题意: 给定2个操作 0、把区间的每个数sqrt 2、求和 因为每个数的sqrt次数很少,所以直接更新到底,用个标记表示是否更新完全(即区间内的数字只有0,1就不用再更新了) #include #include #include #include #include #include #include #include using namespace std; #define N 1000...
分类:其他好文   时间:2014-05-11 21:02:45    阅读次数:325
UVA 417 - Word Index(数论)
题意:417 - Word Index 题意:每个字符串按题目中那样去映射成一个数字,输入字符串,输出数字 思路:这题还是比较水的,由于一共只有83000多个数字,所以对应一个个数字去映射就可以了,注意字符串进位的情况处理即可 代码: #include #include #include #include using namespace std; char str[10]; ma...
分类:其他好文   时间:2014-05-11 20:49:23    阅读次数:428
九度 1201
#include #include using namespace std; #ifdef ONLINE_JUDGE #define FINPUT(file) 0 #define FOUTPUT(file) 0 #else ...
分类:其他好文   时间:2014-05-11 20:30:57    阅读次数:308
CF大神的模板
#include #include #include #include #include #include #include #include #include #include #include #include using namespace std;//#pragma comment(link...
分类:其他好文   时间:2014-05-11 17:31:00    阅读次数:275
boost日期用法
// boost2.cpp : 定义控制台应用程序的入口点。 //boost gregorian_date usage //made by davidsu33 2014-5-10 #include "stdafx.h" #include #include #include #include #include using namespace std...
分类:其他好文   时间:2014-05-11 03:46:57    阅读次数:814
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!