Thread: Comments in C: "//" vs. "*/ /*"

  1. #1
    Beginning game programmer Petike's Avatar
    Join Date
    Jan 2008
    Posts
    64

    Question Comments in C: "//" vs. "*/ /*"

    Hi,
    is this type of comment supported in ANSI C:
    Code:
    printf("Hello World\n");   // Prints "Hello World"
    Because I am not sure if it could be used only in C++.

    Thanks.
    Petike

  2. #2
    Registered User
    Join Date
    Jan 2008
    Posts
    569
    yes it is

  3. #3
    Beginning game programmer Petike's Avatar
    Join Date
    Jan 2008
    Posts
    64
    Thanks.
    Petike

  4. #4
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Not in C89. But a lot of compilers support it as an extension (it was however made standard in C99).

    And ANSI C *usually* refers to C89 -- so the answer is no.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. removing comments of type '//' and '/*'
    By rohit83.ken in forum C++ Programming
    Replies: 3
    Last Post: 10-20-2007, 02:24 AM
  2. Comments problem with MSVC 2003
    By mikahell in forum Tech Board
    Replies: 7
    Last Post: 09-04-2006, 06:04 PM
  3. String parsing(parsing comments out of HTML file)
    By slcjoey in forum C# Programming
    Replies: 0
    Last Post: 07-29-2006, 08:28 PM
  4. The Art of Writing Comments :: Software Engineering
    By kuphryn in forum C++ Programming
    Replies: 15
    Last Post: 11-23-2002, 05:18 PM
  5. comment on my comments
    By anthonye in forum C Programming
    Replies: 8
    Last Post: 02-01-2002, 11:31 AM