C++ファイルで指定した内容を置換

1049 ワード

/*            
----Created by cryking----
--------2012.02.12--------*/
#include
#include
#include
#include
using namespace std;

char *strstr_rep(char *source,char *old,char *ne)//    
{
 char *org=source;
 char temp[256];
 int old_length=strlen(old);//             
 int i,j,k,location=-1;
 for(i=0;source[i]&&(location==-1);++i)//location             
  for(j=i,k=0;source[j]==old[k];j++,k++)
   if(!old[k+1])
    location=i;
   if(location!=-1)//    
   {
    for(j=0;j>ch) {//          buffer
  buffer[i]=ch;
     i++;
 } 
 strstr_rep(buffer,"2222","8888");// "2000"   8888"
 outfile.close();
  ofstream infile("test.txt");
  while(k!=i){infile<
久しぶりにコードを叩いて、ああ..手が生まれた!!!