Comment in C / C ++
The comment of the program is the explanation of the code writer in C / C ++ code, helping the reader, checking the source code is easier to understand. All programming languages have their own syntax for commenting.
C ++ supports single-line and multi-line comments. All characters in the comment are ignored by the C / C ++ compiler.
Comment in C / C ++ starts with / * and ends with * /. Below is an example of a single-line comment and multi-line comment in C ++:
/* Day la mot comment don dong */ /* C/C++ cung ho tro cac comment * trai dai tren nhieu dong */
A comment can also start with //, extending to the end of the line. For example:
#include using namespace std; main() { cout << "Hoc C/C++ co ban va nang cao"; // In dong chu Hoc C/C++ co ban va nang cao return 0; }
When the above code is compiled, it will skip // Print C / C ++ and get high results and finally give the following result:
Hoc C/C++ co ban va nang cao
Inside the comment / * and * /, the characters // have no special meaning. Inside the // comment, the characters / * and * / have no special meaning. Therefore, you can "nest" these two types of comments together. For example:
/* Comment ve dong lenh in dong chu Hello World: cout << "QTM xin chao cac ban!"; // in dong chu QTM xin chao cac ban! */
According to Tutorialspoint
Previous article: Basic C ++ syntax
Next lesson: Data type in C / C ++
You should read it
- Good comments in Korean so you can send to idols
- Instructions to turn on 'Rating comments' for posts on Facebook
- Facebook tested the private comment feature, set the right to read comments
- How to use comments, notes (comments) in Word
- Facebook confirms it is testing comments with stickers
- How to hide comments on Threads, filter inappropriate comments Threads
- How to turn off comments in Facebook
- Caption tags in HTML
May be interested
- Instructions to turn on 'Rating comments' for posts on Facebookperhaps you don't know, facebook allows ranking comments for all public posts from users on social networks, which makes it easy to follow the comments that are most relevant to our shared content. .
- How to Comment on YouTubethis article shows you how to comment on videos on youtube, as well as how to comment in a way that gets more likes and responses. you can use this method for both desktop and mobile versions of youtube.
- How to insert pictures into an Excel comment boxthis article will guide you to insert images into an excel comment box in the simplest and easiest way when using excel software.
- How to Comment with Timeline on YouTubethis tipsmake article will show you how to leave a comment with a timestamp so that it links to a point in the video on youtube.
- How to create an automatic comment filter on YouTubein addition to manually censoring youtube comments, we can completely create youtube automatic comment filters, to remove objectionable comments in your youtube channel.
- How to Insert a Comment Box in Word, PowerPoint, and Excelcommenting is a great feature built into the microsoft office programs for collaboration purposes. you will be able to insert your comment on any part of the document. this can be easily done on any version of microsoft office products....
- Beware of These 5 YouTube Comment Scams!youtube has a huge user base, which unfortunately makes it a prime target for scammers.
- Comment tag in HTMLthe comment tag is used to insert comments and comments in the code.
- How to write bold, italic, dash, ... on Comment Youtube, G +with just a few small steps below, you can write bold, italic or dash on youtube, g + to make a difference in countless other comments.
- Facebook has allowed commenting with colorful backgroundsrecently, facebook has added new features that allow users to write comments, comments with background color, similar to when posting facebook status with background color.