Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C Style commenting
#21
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:

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 Smile
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply


Messages In This Thread
C Style commenting - by oracle - 01-01-2004, 03:18 AM
C Style commenting - by red_Marvin - 01-01-2004, 03:35 AM
C Style commenting - by oracle - 01-01-2004, 04:16 AM
C Style commenting - by adosorken - 01-01-2004, 05:18 AM
C Style commenting - by Zack - 01-01-2004, 05:52 AM
C Style commenting - by oracle - 01-01-2004, 06:08 AM
C Style commenting - by Plasma - 01-01-2004, 06:16 AM
C Style commenting - by oracle - 01-01-2004, 06:18 AM
C Style commenting - by Plasma - 01-01-2004, 07:45 AM
C Style commenting - by adosorken - 01-01-2004, 08:02 AM
C Style commenting - by Agamemnus - 01-01-2004, 08:29 AM
C Style commenting - by adosorken - 01-01-2004, 08:45 AM
C Style commenting - by Plasma - 01-01-2004, 10:17 AM
C Style commenting - by Anonymous - 01-01-2004, 10:31 AM
C Style commenting - by adosorken - 01-01-2004, 10:46 AM
C Style commenting - by Zack - 01-01-2004, 08:39 PM
C Style commenting - by wildcard - 01-01-2004, 08:46 PM
C Style commenting - by Zack - 01-01-2004, 08:47 PM
C Style commenting - by Fling-master - 01-01-2004, 08:49 PM
C Style commenting - by Moneo - 01-02-2004, 06:52 AM
C Style commenting - by na_th_an - 01-02-2004, 06:56 AM
C Style commenting - by Moneo - 01-02-2004, 07:06 AM
C Style commenting - by na_th_an - 01-02-2004, 07:13 AM
C Style commenting - by Moneo - 01-02-2004, 07:40 AM
C Style commenting - by na_th_an - 01-02-2004, 07:48 AM
C Style commenting - by Moneo - 01-02-2004, 07:55 AM
C Style commenting - by oracle - 01-02-2004, 08:06 AM
C Style commenting - by na_th_an - 01-02-2004, 08:26 AM
C Style commenting - by oracle - 01-02-2004, 10:01 AM
C Style commenting - by na_th_an - 01-02-2004, 10:27 AM
C Style commenting - by oracle - 01-02-2004, 10:30 AM
C Style commenting - by adosorken - 01-02-2004, 10:31 AM
C Style commenting - by Mango - 01-02-2004, 03:37 PM
C Style commenting - by Rhiannon - 01-02-2004, 04:46 PM
C Style commenting - by LooseCaboose - 01-04-2004, 12:30 PM
C Style commenting - by Agamemnus - 01-05-2004, 01:10 AM
C Style commenting - by oracle - 01-06-2004, 03:59 AM
C Style commenting - by Agamemnus - 01-06-2004, 08:39 PM
C Style commenting - by oracle - 01-07-2004, 03:33 AM
C Style commenting - by Agamemnus - 01-07-2004, 07:02 AM
C Style commenting - by oracle - 01-07-2004, 08:23 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)