Last active
August 29, 2015 14:00
-
-
Save 1c7/81080f317025154d92ae to your computer and use it in GitHub Desktop.
read-1c7.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <fstream> | |
#include <iostream> | |
#include <string> | |
// read some file for pratice | |
using namespace std; | |
int main(){ | |
ifstream fin("read.txt"); | |
string line; | |
while(getline(fin, line)){ | |
cout << line << endl; | |
} | |
} | |
// 这个C++程序读取read.txt文件,然后输出里面的所有内容 | |
// 在 Ubuntu 上编译: g++ read-1c7.cpp | |
// 执行: ./a.out |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment