ok perhaps you all could help me with this illegal operation
when i attempt to use the code and try replacing all "\n" with "\r\n" i get an illegal operation..
i am calling the code as followsCode:char* replacestr(const char* str,const char* crt,const char* rep,char*trg){ char* temp=trg; for(;*str; ){ for(const char*i=crt,*j=str;*j&&*i&&*i==*j;j++,i++); if (!*i){ for(i=rep;*i;*trg++=*i++)str++; str=j; }else *trg++=*str++; } *trg=0; return temp; };
pszfiletext is defined as LPSTR pszFileText and contains the data from a previously loaded txt file..Code:replacestr(pszFileText, "\r", "\r\n", pszFileText);




Reply With Quote