Removing Multiline Comments From C++file

  • Uploaded by: yetendra singh chauhan
  • 0
  • 0
  • June 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Removing Multiline Comments From C++file as PDF for free.

More details

  • Words: 89
  • Pages: 2
#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; }

Related Documents


More Documents from ""