You've already forked tiny-project
Changes
This commit is contained in:
9
onefile/README.md
Normal file
9
onefile/README.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# 单文件 (onefile)
|
||||
## 简介
|
||||
单文件小程序
|
||||
## 支持
|
||||
每个文件都是一个不同的程序
|
||||
请分别根据注释运行
|
||||
## 协议
|
||||
详见文件内部注释
|
||||
如无注释, 根据 GPL 3.0 协议开源
|
31
onefile/file_reader.cpp
Normal file
31
onefile/file_reader.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
// main.cpp
|
||||
// author: Wang Zhiyu
|
||||
// SFIS C++ Project
|
||||
#include <bits/stdc++.h>
|
||||
using namespace std;
|
||||
|
||||
int main(int argc, char *argv[]){
|
||||
fstream config;
|
||||
config.open(argv[1], ios::in);
|
||||
if(config){
|
||||
cout << "Reading Data" << endl;
|
||||
vector<string> data;
|
||||
string tmp;
|
||||
while(getline(config,tmp)){
|
||||
data.push_back(tmp);
|
||||
}
|
||||
cout << "Redirect to terminal:" << endl;
|
||||
for(int i = 0;i < data.size();i++){
|
||||
cout << data[i] << endl;
|
||||
}
|
||||
config.close();
|
||||
}
|
||||
else{
|
||||
cout << "File NOT Found" << endl;
|
||||
}
|
||||
cout << "Press any key to Continue...";
|
||||
cin.clear();
|
||||
cin.sync();
|
||||
cin.get();
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user