- 696 名前:デフォルトの名無しさん [2008/02/25(月) 14:32:39 ]
- C++
開発環境 CentOS コンパイラ g++ 関数書き出しプログラムが機能せず。 どうしてでしょうか。 #include <iostream> #include <fstream> #include <cstring> #include <string> #define buffer_size 1000 using namespace std; int main(int argc,char *argv[]){ string buffer; int count=0; char *p; ifstream fin(argv[1]); if(!fin)return 0; while(fin>>buffer){ while(count!=1){ if((p=strchr(buffer.c_str(),'{'))!=NULL){ count++; cout<<buffer; } } while(count!=0){ if((p=strchr(buffer.c_str(),'{'))!=NULL)count++; else if((p=strchr(buffer.c_str(),'}'))!=NULL)count--; } } fin.close(); return 0; }
|

|