01-04-2004, 12:30 PM
The // comment is now legal in the C99 standard: http://gcc.gnu.org/c99status.html.
Also, if you are writting a comment remover for C, then it needs to replace comments with a single space for it to be legal, otherwise you can do this.
Which will look like this after removing comments (incorrect):
When it should be:
Which doesn't compile. This is why the token paste operator (##) got introduced.
Also, if you are writting a comment remover for C, then it needs to replace comments with a single space for it to be legal, otherwise you can do this.
Code:
int a, b, ab;
a/* Token paste */b = 10;
Which will look like this after removing comments (incorrect):
Code:
int a, b, ab;
ab = 10;
When it should be:
Code:
int a, b, ab;
a b = 10;
Which doesn't compile. This is why the token paste operator (##) got introduced.
esus saves.... Passes to Moses, shoots, he scores!