|
|
#1 | |
|
Single Lines In C Comments
When reading an older development book, I found this:
Quote:
|
||
|
|
0
|
|
|
#2 |
|
Originally, the only style for commenting in C was /* ... */. This is still the case in C89, which is traditionally known as ANSI-C. C99 added support for one line comments using //. If your book was written before the C99 standard was approved, it was correct at the time, and still is for older systems.
|
|
|
|
2
|
|
|
#3 |
|
Ok, thank you, I understand now. I haven't actually ever used anything besides C99
|
|
|
|
0
|
|
|
#4 |
|
// comments originally came from C++, IIRC.
|
|
|
|
0
|
|
|
#5 |
|
|
0
|
|
|
#6 |
|
Why does it matter?
There was a period of time when the C compilers used by Apple accepted // comments even though it wasn't in the ANSI/ISO C standard of the time. There was a command-line option for strict C conformance that would turn this off, so // was forbidden. IIRC, there was another option that would force strict compliance to the ISO C standard, EXCEPT that // comments were allowed. Other than as a historical footnote, none of this matters today, and hasn't since C99. |
|
|
|
0
|
|
|
#7 |
|
They originally came from BCPL, which was also the first brace programming language. But, this is just esoteric trivia.
__________________
15'' Early 2011 MBP | iPhone 5 | iPad (2012) | MacOS X 10.8.3 |
|
|
|
0
|
|
|
#8 | |
|
Quote:
|
||
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
All times are GMT -5. The time now is 02:15 PM.








Linear Mode
