Mail Archives: djgpp/1995/07/05/15:18:37
In article <DAyyCx DOT HxK AT jade DOT mv DOT net>,
Mitran/Marcel/Mr <nverever AT wendy DOT ee DOT mcgill DOT ca> wrote:
>Okay, I wrote a program which takes command line parameters. The program
>parses them in the following way:
> switch (*Param){
> ... /*A few cases here, too long to mention */
> case 'p':
> Param++;
> if (*Param == 'a') /*The first parameter(-pa)*/
> {...}
> if (*Param == 'b') /*The second parameter(-pb)*/
> {...}
>However, if I remove the comment:
>/*The first parameter */, the -pb if doesn't work anymore.
Looks like you have unmatched comment delimiters. For example:
/* This comment begin token is unmatched on this line
code_that ("Won't run"); /* <- this is ignored, we're
still in a comment */
code_that ("Will run"); /* because the compiler sees
the * / above... */
> I don't think it's normal that where I comment my code should
>affect the compiler output. I guess it's true, well commented code
Oh yeah? Try commenting out your entire program - your comments *will*
affect the compiler's output... :-)
>does lead to better programs! Seriously, is this a bug or a programming
>error on my part? Am I the only one who has this problem?
Your error, and no - unmatched parens, braces and comments are just
something that you have to be careful about - the compiler will complain
you about the parens and braces, but it has no idea what you meant
to comment out.
James
--
fn info guess {if {~ $guess 'James Ojaste'} {echo Right!} {~ $guess es-lover} {
echo Yup!} {~ $guess csclub.uwaterloo.ca} {echo Uh-huh!} {~ $guess INTX} {
echo Ding!} {echo Bzzzt!}}
- Raw text -