You must submit your program electronically via gsubmit on csa.
Under no circumstances will late assignments be accepted.
The code you submit must conform with the programming guidelines.
The program reads a stream of characters from standard input. It writes the same stream of characters to standard output, with all C++ comments removed.
Your program should not remove new-line characters unless they appear within a multi-line comment. This means that your program must preserve new-line charaters in all other cases.
You should be careful to only remove valid comments, as defined by standard C++ comment syntax rules.
Your program should properly handle line comments:
int i; // this is a line comment
Your program should properly handle multi-line comments:
/* this is a
multi-line
comment */
Your program should properly ignore comment delimiters that appear within quotes:
" this is a comment delimiter within a /* quote "
Final note: when '\"' appears within a quote, it does not close the quote.
You can copy and modify this wrapper, filling in the missing pieces needed to complete the assignment. Please read the file header for more information.
You are responsible for thoroughly testing your program to make sure that it works. In grading your program, we will test your program on some standard test files. To help you get started, here is one test file:
and here is the correct, filtered output:
You should compare your output with this file to make sure it matches. You should also generate your own test files. Use them to test your program further, however do not submit your test files.