answersLogoWhite

0


Best Answer

Single line

Eg:

1

//This is a Single line comment

ii. Multiple line (/* */)

Eg:

1

2

3

/*This is a multiple line comment

We are in line 2

Last line of comment*/

iii. XML Comments (///).

Eg:

C#

1

2

3

/// summary;

/// Set error message for multilingual language.

/// summary

User Avatar

Wiki User

7y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are the types of comment in C?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is single line comments as used in C programming?

single line comment are comment written in single line.in c there are two types of comment single line and multiple line.single line comment is written using // and multiple line comment is written between /*comment*/.compiler does not compile comments.it is used for better understanding of program.


What is single line comment?

single line comment are comment written in single line.in c there are two types of comment single line and multiple line.single line comment is written using // and multiple line comment is written between /*comment*/.compiler does not compile comments.it is used for better understanding of program.


What are the ways to comment statement in C?

Most of C/C++ will support two types of comments:* // Comment text goes here (aka inline)* /* Comment goes here */ (aka block)But the first comment type is not in ANSI C standard, you will get an error message.In order to compile your program with ASNI C standard using GCC, I suggest this:gcc -Wall -ansi -pedantic -oRemoving "-ansi" would allow usage of the first type comments in C language.


What are the two types of comments in c programming language and how do they differ?

C uses two types of comment: single-line and multi-line. The multi-line comment originated in C while the single-line comment originated in C++. Both types are supported by both languages today. A single-line comment begins with the double-slash token (//) and extends to the end of the line. A multi-line comment begins with the slash-asterisk token (/*) and ends with the asterisk-slash token (*/). Examples: int x; // this is a single-line comment /* this is multi-line comment, typically used to introduce a function or class */ Note that since multi-line comments are fully-delimited, they may be used within the middle of a line of code. This is most useful when a function is forward-declared with a default value for one of its arguments and you wish to include that default value in the function definition (something which is not permitted under the one-definition rule): void f (int = 0); // declaration void f (int x /* = 0 */) { // definition } Such usage is really only of use to the function maintainer, as a reminder that the function has a default value. We can also use this technique when a function has an argument that is reserved for future use, but is otherwise unused in the current version of the function: void g (int); // declaration void g (int /* unused */) { // definition } Again, such usage is only of use to the function maintainer.


Can comment span more than one line in c?

Yes, you can use the multiline comment. Start the comment with /* and end the comment with */


One of the most common types of writing online is?

Hi it's me Mario


What is a pqc paragraph?

A stands for awnser c stands for comment q stands fote qoute from the text c stands for comment # 2


Definition of comments in c plus plus?

In C++, you can write comments two different ways. The old way, which is C compatible, is to bracket the commented text with /* and */. These comment operators extend across lines. The new way, for C++, is the single line comment. You start the comment with //, and everything from that point to the end of the current line is a comment.Note: You can use the preprocessor as well:#if 0Many many lines of comments#endif


What starts a comment in a C-base language?

// This is a one-line comment /* This is another comment Everything between the slash-star and the star-slash is commented out If you forget to close this comment you will get a compiler error */


What is a correct way to add a comment in PHP?

There are many ways to comment in PHP, all of them valid: /* Classic C style, which allows you to comment blocks rather than single lines */ // C++ Style, which remarks the remainder of a single line # bash style, which also is a rest-of-the-line comment


What is comment in C?

Something that the compiler ignores.Comments are enclosed between /* and */.


What are 11 back slashes use in c?

Two backslashes (//) indicate the start of a line comment in C, where the comment extends to the end of the line. 11 backslashes is therefore a comment containing 9 backslashes. Comments of this kind are usually used to provide a visual break between two segments of code. Note that comments in C-style comments open with /* and close with */ and may extend across multiple lines. The double-backslash line comment originated in C++ and was later adopted by C.