很经典的书籍

源代码在线查看: exercise16.cpp

软件大小: 1473 K
上传用户: wilsonshaw
关键词: 书籍
下载地址: 免注册下载 普通下载 VIP

相关代码

				//: C04:Exercise16.cpp
				#include 
				#include 
				#include 
				#include "../require.h"
				using namespace std;
				#define d(a) cout 				
				void tellPointers(fstream& s) {
				  d(s.tellp());
				  d(s.tellg());
				  cout 				}
				void tellPointers(stringstream& s) {
				  d(s.tellp());
				  d(s.tellg());
				  cout 				}
				int main() {
				  fstream in("Exercise16.cpp");
				  assure(in, "Exercise16.cpp");
				  in.seekg(10);
				  tellPointers(in);
				  in.seekp(20);
				  tellPointers(in);
				  stringstream memStream("Here is a sentence.");
				  memStream.seekg(10);
				  tellPointers(memStream);
				  memStream.seekp(5);
				  tellPointers(memStream);
				} ///:~
							

相关资源