comments

This is a discussion on comments within the C Programming forums, part of the General Programming Boards category; hey, i thought // was used in C++ and not in C. i don't think i can use // in ...

  1. #16
    Registered User
    Join Date
    Jul 2003
    Posts
    30
    hey, i thought // was used in C++ and not in C. i don't think i can use // in C. well, that's what i learnt!

    Once more, thx to all of you. i don't know how you find time to help us but u're angels

  2. #17
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    >> i don't think i can use // in C.
    Older compilers don't support the // syntax, so it may be best to stick to /**/.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #18
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,584
    Older compilers don't support the // syntax, so it may be best to stick to /**/.
    How old are we talking here? Turbo C++ version 1.0 from 1985? supports it.

  4. #19
    Registered User
    Join Date
    Jul 2003
    Posts
    30
    in fact we're talking about C. the old version. well, we've started with it at uni and next semester we're doing C++.

  5. #20
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,584
    in fact we're talking about C. the old version. well, we've started
    with it at uni and next semester we're doing C++.
    You can download Turbo C version 2.0 from the mid 80's on Borland/Inprise's website and it supports // AFAIK.

  6. #21
    Registered User
    Join Date
    Jul 2003
    Posts
    30

    thx

    thx but don't think i'll use C anymore coz exams will end in 2 weeks time and next semester we're doing C++. think it's much better than C.

  7. #22
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,584
    C++ is not better than C. Like comparing apples and apples.

    C++ is a superset of C, an extension to an already great language.

  8. #23
    Registered User
    Join Date
    Jun 2003
    Posts
    124
    >C++ is a superset of C
    which means that
    C++ is better than C - no doubt.
    Loading.....
    ( Trying to be a good C Programmer )

  9. #24
    Registered User
    Join Date
    Jul 2003
    Posts
    30
    lol. that's what i meant too.

  10. #25
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,584
    >C++ is a superset of C
    which means that
    C++ is better than C - no doubt
    One is not better than the other. Just a matter of opinion. Both very useful, both very powerful, both have their place.

  11. #26
    Registered User
    Join Date
    Jun 2003
    Posts
    124
    I don't say C isn't powerful, but if you have a taste of C++ you won't return back to C..
    Loading.....
    ( Trying to be a good C Programmer )

  12. #27
    eh ya hoser, got a beer? stumon's Avatar
    Join Date
    Feb 2003
    Posts
    323
    Funning thing is, a lot of C++ compilers are written in C. So how would C++ be better. Its not better, just a different style.

    The real question for "is C++ better than C", is whether you think OOP is better than non-OOP?
    The keyboard is the standard device used to cause computer errors!

  13. #28
    Registered User
    Join Date
    Jul 2002
    Posts
    913
    The real question
    ,why do you have strings in c++ instead of arrays of charcters?

    why was another thingy created just so you dont have to have a '.h' at the end of your includes?

  14. #29
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Originally posted by mart_man00
    ,why do you have strings in c++ instead of arrays of charcters?
    You have both. You can use whatever one does the job. String classes are generally "better" because they aren't as easily confused. (IE: Less prone to memory leaks, though you still can, and less likely to trash your program by running off the end of your allocated space.)

    Quzah.
    Hope is the first step on the road to disappointment.

  15. #30
    eh ya hoser, got a beer? stumon's Avatar
    Join Date
    Feb 2003
    Posts
    323
    >>why was another thingy created just so you dont have to have a '.h' at the end of your includes?

    Because if your building a 1000 line file, why would you want that much more to type. lol, count the number of times you typed ".h" since the first time you started programming and think about how much time you would save not having to type them. 1 is miniscule (spelling???) but 100,000 is a lot.
    The keyboard is the standard device used to cause computer errors!

Page 2 of 3 FirstFirst 123 LastLast
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. String parsing(parsing comments out of HTML file)
    By slcjoey in forum C# Programming
    Replies: 0
    Last Post: 07-29-2006, 08:28 PM
  3. GCC not able to distinguish comments inside string
    By Yasir_Malik in forum C Programming
    Replies: 11
    Last Post: 06-23-2005, 12:11 PM
  4. The Art of Writing Comments :: Software Engineering
    By kuphryn in forum C++ Programming
    Replies: 15
    Last Post: 11-23-2002, 04:18 PM
  5. comment on my comments
    By anthonye in forum C Programming
    Replies: 8
    Last Post: 02-01-2002, 10:31 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21