Comments are notes in your code ignored by the compiler. They're useful for explaining code, making it easier to understand.
Comments आपके कोड में नोट्स होते हैं जिन्हें compiler इग्नोर करता है। यह कोड को समझने में आसान बनाते हैं।
//
and runs to the end of the line./*
and ends with */
.//
से शुरू होकर लाइन के अंत तक चलता है।/*
से शुरू और */
पर खत्म होता है।#include <iostream>
using namespace std;
int main() {
// This is a single-line comment
cout << "Hello, World!" << endl;
/* This is a
multi-line comment
explaining the next line */
cout << "Welcome to C++ Comments Guide!" << endl;
return 0;
}
In this example, //
adds single-line comments, and /* ... */
adds multi-line comments to explain the code.
इस उदाहरण में, //
single-line comment जोड़ता है और /* ... */
multi-line comment जोड़कर कोड को समझाता है।