/* */ - is the only one used in c..
c++ has both
2007-01-17 04:10:19
·
answer #1
·
answered by Wesley C 3
·
1⤊
0⤋
Comments In C
2016-09-28 03:20:21
·
answer #2
·
answered by ? 4
·
0⤊
0⤋
I can't believe how many people answered with misleading or incomplete answers. People, don't post guesses.
C definitely supports /* Comment here */ type comments. Such comments are multiline comments, so you can have
/*
Comment 1
Comment 2
*/
The question is with inline comments that are a part of C++.
code here // comment here
Note that they are not multiline. Inline comments are OK in C99, but in C90 they are not.
So you need to find out how old your C compiler is and what standard it supports. If it supports C99, you know it supports inline comments, otherwise no.
2007-01-17 04:17:43
·
answer #3
·
answered by csanon 6
·
1⤊
0⤋
For the best answers, search on this site https://shorturl.im/aw1gy
The precompiler recognizes that all text contained in a /* and */ are comments. There are different sorts of comments. Depending on your compiler, it may also recognize c++ commenting, like // .
2016-04-10 07:47:09
·
answer #4
·
answered by Anonymous
·
0⤊
0⤋
If you want to give a single line comment, try this:
int a=5; //initialization
or a multiline comment you can give this:
/*
Addition Of Two Numbers
By Bill Gates
© Microsoft Corporation
*/
Mostly multiline comments (/* */) are used for documentation. ir providing info about the program
Regards
Praveen Kumar
2007-01-17 03:40:44
·
answer #5
·
answered by P Praveen Kumar 5
·
0⤊
3⤋
This Site Might Help You.
RE:
how to add comments in C programming?
plz suggest me how to add comment in C programming?
is it /* xyz */ ? or // xyz ?
2015-08-18 18:37:22
·
answer #6
·
answered by ? 1
·
0⤊
0⤋
You're right. Both /* */ and // work in c++. But some compilers of C do not support //.
Try Turbo C. Do a google search for "Turbo C download" and click on the first result.
It supports //
2007-01-18 07:03:41
·
answer #7
·
answered by Parry 3
·
0⤊
0⤋
Both are correct.
It is valid both in c as well as c++.
// is used for single line comment
/*
Used
for multiline
comment
*/
One important thing to note is that, comment should note be within another comment.
/*
first line
/*
second line
*/
third line
*/
These kind of comments are invalid.
Hope u got cleared now
2007-01-17 03:45:12
·
answer #8
·
answered by Sudha P 2
·
0⤊
2⤋
hi there.
/* You need 2 comment in C like dis */
2007-01-17 02:57:56
·
answer #9
·
answered by xeus 2
·
0⤊
0⤋
C compilers only accept text within /* */ as comments.
C++ compilers accept text within both /* */ and // as comments.
Remember: You can't have nested comments, e.g.
/* hello
/* I am here */
*/
A good way to provide comments is:
/*
* < text here>
*
*
*/
2007-01-17 03:23:46
·
answer #10
·
answered by Suraj V 1
·
2⤊
0⤋