注册 登录
编程论坛 C++教室

seekg()这个函数的作用是什么?求解答,谢谢!

Theblueman 发布于 2018-05-21 14:42, 1239 次点击
程序代码:
// skipws flag example
#include <iostream>     // std::cout, std::skipws, std::noskipws
#include <sstream>      // std::istringstream

int main () {
  char a, b, c;

  std::istringstream iss (" 12 3");
  iss >> std::skipws >> a >> b >> c;
  std::cout << a << b << c << '\n';

  iss.seekg(0);//这一句删去后得到结果怎么解释?
  iss >> std::noskipws >> a >> b >> c;
  std::cout << a << b << c << '\n';
  return 0;
}
2 回复
#2
rjsp2018-05-21 18:33
http://zh.
#3
Theblueman2018-05-22 00:11
回复 2楼 rjsp
谢谢!
1