Comments in C++
Comments can be used for providing an explanation of the code that makes it easier for others to understand the functionality of the code.
Any statement after the comments will not be executed by the compiler. So comments can also be used to temporarily disable (comment out) the execution of some specific statements without deleting the statements.
Types of Comments:
1. Single-lined
We use two forward slashes // to indicate the single-line comment.
Syntax
// This is a comment
cout << "w3wiki";
2. Multi-lined
We use /* to start a multi-line comment and */ to end it.
Syntax
/* This is multi-lined comment.
The below statement will print w3wiki.*/
cout << "w3wiki";
C++ Cheatsheet
This is a C++ programming cheat sheet. It is useful for beginners and intermediates looking to learn or revise the concepts of C++ programming. While learning a new language, it feels annoying to switch pages and find different websites for different concepts that are easily understandable. You can learn C++ concepts very easily using this cheat sheet.
C++ is a high-level programming language. It was developed in 1983 by Bjarne Stroustrup at Bell Labs. It is used for developing various applications.
Contact Us