please help me in writing the code that takes a c or c++ file and deletes the comments and prints the output to other file

totally 3 files r involved
one removes the comments
other is the program having comments
other is output printed without any comments containing c or c++ code

prethanks to the helper

kindly send the source code or provide link