摘要: #include #include #include #include #include #include #include using namespace std;int fun1(int value){ return value*2;}int fun2(int value1,int val... 阅读全文
posted @ 2012-07-11 15:45 A_zhu 阅读(2329) 评论(0) 推荐(0) 编辑
摘要: 字符串输入输出流,istringstream、ostringstream,可以将输入或输出变成一个string,多次读写或多次输出。 也可以通过这两个实现变量类型的转换,如int 型数据输出到ss(stringstream),然后读取到string 中。#include <iostream>#include <sstream>#include <windows.h>using namespace std;int main(){ string buf; getline(cin,buf);/* 这个可以结合一下语句在处理文件读取时使用,先读整行,然后像cin处理 阅读全文
posted @ 2012-07-11 15:43 A_zhu 阅读(2995) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>using namespace std;template<class T>struct Unit{ public: Unit * next; T value;};template<class T>class MyLink{public: class LinkIterator { private: Unit<T> * init; public: LinkIterator(Unit<T> * init) { this->init=init; ... 阅读全文
posted @ 2012-07-11 15:42 A_zhu 阅读(2790) 评论(0) 推荐(0) 编辑