Compile Crazy
Would you like to react to this message? Create an account in a few clicks or log in to continue.



 
HomePortalLatest imagesSearchRegisterLog in

 

 Comments, oh comments, where have you gone?

Go down 
2 posters
AuthorMessage
The Fellow
Admin
The Fellow


Posts : 100
Join date : 2010-04-28
Age : 31
Location : In my head, dreaming up how to shake up the world

Comments, oh comments, where have you gone? Empty
PostSubject: Comments, oh comments, where have you gone?   Comments, oh comments, where have you gone? I_icon_minitimeWed Oct 13, 2010 7:32 pm

In C (And many other languages) you can have something in your program called a comment. There is two ways to do so.

One way is to do a block comment, good for many lines of code, which is done by:
Code:

/* comment
comment comment
comment comment comment
comment
*/
Simple no? Begin the comment with a /* end it with a */, it is like the two was made for eachother!

The other way a comment can be born is a line comment, which can be put besides a line of code, or what not. good for short messages.
Code:
//comment
Wait, what? that is somewhat simaliar to what we arleady did! just instead of a * there is another /!


Now, before I end this, I want to stress commenting is KEY when it comes to working on programs with others, heck, even yourself if you ever want to edit your code again, and do not want to encounter bugs because you deleted the wrong line!


Last edited by The Fellow on Wed Oct 13, 2010 9:11 pm; edited 1 time in total
Back to top Go down
https://compilecrazy.forumotion.net
Excimer Sun Software

Excimer Sun Software


Posts : 152
Join date : 2010-05-07
Age : 31
Location : USA

Comments, oh comments, where have you gone? Empty
PostSubject: Re: Comments, oh comments, where have you gone?   Comments, oh comments, where have you gone? I_icon_minitimeWed Oct 13, 2010 8:40 pm

Everyone reading this; this is an absolutely essential thing to remember! Very good, Fellow! Just one thing, the single-line comment is just a double-slash to begin the comment and the comment then goes from there to the end of that line of code, no double-slash needed on the end. Mad
Back to top Go down
The Fellow
Admin
The Fellow


Posts : 100
Join date : 2010-04-28
Age : 31
Location : In my head, dreaming up how to shake up the world

Comments, oh comments, where have you gone? Empty
PostSubject: Re: Comments, oh comments, where have you gone?   Comments, oh comments, where have you gone? I_icon_minitimeWed Oct 13, 2010 8:49 pm

lol, well, it happens, I am used to putting one at the end, because it helps me seperate things in my head, thinks for showing that.
Back to top Go down
https://compilecrazy.forumotion.net
Excimer Sun Software

Excimer Sun Software


Posts : 152
Join date : 2010-05-07
Age : 31
Location : USA

Comments, oh comments, where have you gone? Empty
PostSubject: Re: Comments, oh comments, where have you gone?   Comments, oh comments, where have you gone? I_icon_minitimeWed Oct 13, 2010 8:56 pm

Lol, understandable! Want me to fix it for you? xD
Back to top Go down
The Fellow
Admin
The Fellow


Posts : 100
Join date : 2010-04-28
Age : 31
Location : In my head, dreaming up how to shake up the world

Comments, oh comments, where have you gone? Empty
PostSubject: Re: Comments, oh comments, where have you gone?   Comments, oh comments, where have you gone? I_icon_minitimeWed Oct 13, 2010 9:11 pm

lol, nahh
Back to top Go down
https://compilecrazy.forumotion.net
Excimer Sun Software

Excimer Sun Software


Posts : 152
Join date : 2010-05-07
Age : 31
Location : USA

Comments, oh comments, where have you gone? Empty
PostSubject: Re: Comments, oh comments, where have you gone?   Comments, oh comments, where have you gone? I_icon_minitimeWed Oct 13, 2010 9:16 pm

Yep, you got it. Laughing
Back to top Go down
Sponsored content





Comments, oh comments, where have you gone? Empty
PostSubject: Re: Comments, oh comments, where have you gone?   Comments, oh comments, where have you gone? I_icon_minitime

Back to top Go down
 
Comments, oh comments, where have you gone?
Back to top 
Page 1 of 1
 Similar topics
-
» Random comments thread

Permissions in this forum:You cannot reply to topics in this forum
Compile Crazy :: Programming :: C Family :: C :: For Beginners-
Jump to: