1. Engineering
  2. Computer Science
  3. these 2 functions are written in c and their purpose...

Question: these 2 functions are written in c and their purpose...

Question details

void remove_multi_comment(char source[], char dest[]) ifstream fin(source); ofstream fout (dest); char ch; while(!fin.eof()) fin.get(ch); İf (ch-:/. ) fin.get (ch); if(ch- while(!fin.eof() fin.get(ch); İf (ch-:/. ) break; else fout<<ch; fin.close); fout.close)void remove_single_comment (char source[], char dest[]) ifstream fin(source); ofstream fout (dest); char ch; while(!fin.eof)) fin.get(ch); if (ch/) f while(Ifin.eof)) fin.get(ch); break; else else fout<<ch; fin.close(); fout.close();

These 2 functions are written in C++ and their purpose is to remove single and multi line comments in any given (or self-created) file containing C++ language.

Make from these 2 functions in C++ one function that does the same without any errors. Add an error message in case the single or multi line comments are faulty in the given (self-created) file and exit the program.

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution