I was wondering, is the preprocessor the device that handles comment striping? For example, does the preprocessor turn this:Into this:Code:int a = 0; //A comment.If not, what device does?Code:int a = 0;
I was wondering, is the preprocessor the device that handles comment striping? For example, does the preprocessor turn this:Into this:Code:int a = 0; //A comment.If not, what device does?Code:int a = 0;
It seems so. To see the preprocessed code, use -E compiler option for GCC. (Don't know about others.)
Yep, I guess it does. Thanks!
it does more than that. it prepares the code for proccessing - it includes comment striping, but it does more. for example, every line that starts with a # is a preprocessor directive.
In the classic description of the compilation process, the pp is responsible for comment stripping (and white space collapsing and and and ...). Actually, though, most compilers can handle comments directly, too. For example, gcc can accept .i files as input (preprocessed C), and as far as I know those may contain comments.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
I know it does more, I just wanted to know specificaly about the comment striping.