#include<stdio.h> #include #include #include class student { private: char ch,ch1; public:
student() { ch1='/'; } void copy() { fstream obj,obj1; obj.open("new.cpp",ios::in); obj1.open("copy.cpp",ios::out); obj.get(ch); while(!obj.eof()) { if(ch=='"') { obj1.put(ch); obj.get(ch); while(ch!='"') { obj1.put(ch); obj.get(ch); } } if(ch=='/') { obj.get(ch); if(ch!='/'&&ch!='*'&&ch!='\n') { while(1) { obj1.put(ch1); break; } } if(ch=='/') { obj.get(ch); while(ch!='\n') { obj.get(ch); } } else if(ch=='*') { while(1) { obj.get(ch);
} } } else { obj1.put(ch); obj.get(ch);
} }; void main() { student object; object.copy(); }
} } cout<<"copied"; obj.close(); obj1.close();
if(ch=='*') { obj.get(ch); if(ch=='/') break; else continue; }