摘要: #include #include #include using namespace std;void funa(int arg1, string arg2){ cout fun; fun = std::bind(&funa, std::placeholders::_1, std::p... 阅读全文
posted @ 2014-05-11 22:10 zzyoucan 阅读(152) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include #include #include #include #include #include using namespace std;struct MyStruct{ string stru; int ... 阅读全文
posted @ 2014-05-11 18:41 zzyoucan 阅读(3073) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2014-05-11 14:02 zzyoucan 阅读(512) 评论(0) 推荐(0) 编辑
摘要: stringstream本身的复制构造函数是私有的,无法直接用,于是带来了一些复杂的问题网上,流传着几种办法,如streamA.str(streamB.str()),但这种办法,复制的仅仅是初始化时的string会在以下这种情况下暴露出问题: stringstream s1("123aaa")... 阅读全文
posted @ 2014-05-11 11:13 zzyoucan 阅读(270) 评论(0) 推荐(0) 编辑
摘要: 在编写应用程序时,我们经常要使用到字符串。C++标准库中的和为我们操作字符串提供了很多的方便,例如:对象封装、安全和自动的类型转换、直接拼接、不必担心越界等等。但今天我们并不想长篇累牍得去介绍这几个标准库提供的功能,而是分享一下stringstream.str()的一个有趣的现象。我们先来看一个例... 阅读全文
posted @ 2014-05-11 10:49 zzyoucan 阅读(383) 评论(0) 推荐(0) 编辑