Created
November 1, 2010 09:01
-
-
Save johnhmj/657867 to your computer and use it in GitHub Desktop.
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<iostream> | |
#include<cstdlib> | |
#include<fstream> | |
#define BUFFERSIZE 1024 | |
using namespace std; | |
void main(int argc, char* argv[]) | |
{ | |
// 檔案名稱 | |
const char* fn = "123.txt"; | |
fstream f; | |
f.open(fn, ios_base::in); | |
if ( f.is_open() ) | |
{ | |
// 緩衝區 | |
char buffer[BUFFERSIZE] = {0}; | |
while ( ! f.eof() ) | |
{ | |
f >> buffer; | |
// | |
// 自行加程式碥:四則運算或是其他運算 | |
// | |
} | |
f.close(); | |
} | |
system("PAUSE"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment