//------------------------------------------- // add_head.cpp ver 1.00 // // 各行、先頭 // を // 追加 // 一行は半角2048まで // // 2000/12/07(木) // 2000 Copyright charlie, // All rights reserved // happypoint@geocities.co.jp // http://www.geocities.co.jp/SiliconValley-Bay/6716/ // //------------------------------------------- #include #include #include #include #include #define debug const int buffmax=2048; char endmark='\n'; char init[]="add_head.ini"; char infname[buffmax]; char outfname[buffmax]; char buff[buffmax*5]; char add[buffmax]; //------------------------------------------- void getfname() { printf("input the word:"); scanf("%s",add); printf("input file:"); scanf("%s",infname); printf("output file:"); scanf("%s",outfname); } //------------------------------------------- void add_head(ifstream &in,ofstream &out) { char buff[buffmax*5],buff0; //bufferのおおきさは、適当 char* p; while(1) { in.get(buff,buffmax,'\n'); //<まで読みこむ if(in.eof())break; in.get(buff0); out<