01-02-2004, 06:56 AM
Well, // was introduced with C++, but most C compilers won't complain if you use them. Anyhow it is good practice to use /* and */ if you are coding in C and you are focusing on portability.
Nested comments are not allowed. The C parser is really lazy so it will fail with something like this:
It will simply ignore the second /*, and when it finds the first */ it will consider that the comment has ended so End! will cause a parse error.
As for the challenge, as Moneo has said it is something completely useless yet very easy to code. A simple FSM will do and you could have it in 10 lines of code or less (I mean only the parsing). I'll be entering, but maybe tomorrow. I'm busy right now
Nested comments are not allowed. The C parser is really lazy so it will fail with something like this:
Code:
/* This is a comment
/* This is anested comment */
End! */
It will simply ignore the second /*, and when it finds the first */ it will consider that the comment has ended so End! will cause a parse error.
As for the challenge, as Moneo has said it is something completely useless yet very easy to code. A simple FSM will do and you could have it in 10 lines of code or less (I mean only the parsing). I'll be entering, but maybe tomorrow. I'm busy right now
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i