Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char * deltext(char *sim, int nc, int endc){
- int i;
- int dl=endc-nc;
- for(i=nc;sim[i]!=0;++i){
- sim[i]=sim[i+dl];
- }
- return sim;
- }
- int main(int narg, char **arg){
- char sim[]="123 /*text*/ 123 /*text*/ qwe jjj";
- int i,nc=-1,endc;
- for(i=0;sim[i]!=0;++i){
- if((sim[i]=='/')&&(sim[i+1]=='*')){
- nc=i;//íà÷àëî
- }else if((nc!=-1)&&(sim[i]=='*')&&(sim[i+1]=='/')){
- endc=i;
- *sim=* deltext(sim,nc-1,endc+2);
- }
- }
- cout << sim;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement