There are lots of things that make this non-trivial:
1. Comment characters can appear inside strings.
Code:
printf("//I am not a comment!");
2. Strings themselves can contain \" making their end harder to detect than you might think.
Code:
printf("Well, \"I am not // a comment either\"");
3. /*/ can be either the start or the end of a comment block.
Code:
Add or remove the first slash on the next line and change an addition into a multiply.
//*
a = b + c;
/*/
a = b * c;
// */
4. Removing /* */ style comments can screw up code that uses them as the only separator between two other symbols. In fact you won't even necesarily get a compile error. Contrived example
Code:
#define a 1
#define b +2
#define ab 12
int x = a/*careful taking me out!*/b;
Bottom line, doing this completely correctly requires a basic parser, not just a search and replace mechanism. It doesn't need to be as complex as a C compiler though.
The real question though is, why would you write such a thing? Surely comments are an asset?