|
| | Comments, oh comments, where have you gone? | |
| | Author | Message |
---|
The Fellow Admin
Posts : 100 Join date : 2010-04-28 Age : 31 Location : In my head, dreaming up how to shake up the world
| Subject: Comments, oh comments, where have you gone? Wed 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 | |
| | | Excimer Sun Software
Posts : 152 Join date : 2010-05-07 Age : 31 Location : USA
| Subject: Re: Comments, oh comments, where have you gone? Wed 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. | |
| | | The Fellow Admin
Posts : 100 Join date : 2010-04-28 Age : 31 Location : In my head, dreaming up how to shake up the world
| Subject: Re: Comments, oh comments, where have you gone? Wed 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. | |
| | | Excimer Sun Software
Posts : 152 Join date : 2010-05-07 Age : 31 Location : USA
| Subject: Re: Comments, oh comments, where have you gone? Wed Oct 13, 2010 8:56 pm | |
| Lol, understandable! Want me to fix it for you? xD | |
| | | The Fellow Admin
Posts : 100 Join date : 2010-04-28 Age : 31 Location : In my head, dreaming up how to shake up the world
| Subject: Re: Comments, oh comments, where have you gone? Wed Oct 13, 2010 9:11 pm | |
| | |
| | | Excimer Sun Software
Posts : 152 Join date : 2010-05-07 Age : 31 Location : USA
| Subject: Re: Comments, oh comments, where have you gone? Wed Oct 13, 2010 9:16 pm | |
| Yep, you got it. | |
| | | Sponsored content
| Subject: Re: Comments, oh comments, where have you gone? | |
| |
| | | | Comments, oh comments, where have you gone? | |
|
Similar topics | |
|
| Permissions in this forum: | You cannot reply to topics in this forum
| |
| |
| |
|