Comments In C++
Dear Students, aaj ke is Lecture me hum janege Comments In C++ ke bare main. Yani ke C++ language main comments kaise karte hai. Or sath me comments kya hote hai. Types of comments in C++ aadi se related ye sare topic ham Comments In C++ ke lecthure me cover karege.
Lectures Covering Topics
- Introduction To Comments In C++ In Hindi
- What Is Comments In C++ In Hindi
- Types To Comments In C++ In Hindi
- Multi Lines Comments In C+ In Hindi
Comment ka matlab hota hai tippani karna. Yani ki kisi special object ke liye kisi khas bat ka kahna eak comment kahlata hai. Real life main hum jab kisi khas person ke liye koi khas bat kahte hai.
To vah us khas bat ko kabhi nahi bhoolta hai. Kyonki vah bat uski importance ke liye boli gayi hai. Wo boli gayi eak khas bat jiske through hum sara moment yad rakhte hai vah comments kahalata hai.
Introduction To Comments In C++ In Hindi
Jab hame program main koi method ya fir koi khas statements yad rakna ho. To hum uske liye comments ka use karte hai. Kisi program main hum kahi bhi comments likh sakte hai. kisi bhi program main hum one more then comments likh sakte hai.
Comments kisi bhi language main hamare program ke statements ko samjhne ke liye likha jata hai. Hamara likha hua program agar koi or bhi pade to aasani se vah us program ke code ko samjh sake. Kisi bhi chhote program ke coding dekh kar to hum sab us program ko aasani se samjh sakte hai.
But agar program bahut he bada hua to aap pane code ko he dekha kar nahi samjh payege ki mene ye code kis problem ki solution ke liye likha tha. Aise me humate liye comments eak bahut kaam ke cheej ho sakte
Sabse important bat yah bhi hai ki program me hum comments me jo bhi likhte hai. Or jab hum program ko run karate hai wo display par najar nahi aata hai. To ab hum seekhenge ki exam main hume comments in c ko kaise explain karna hai.
What Is Comments In C++ In Hindi
Student’s “comments in C++ language are used to provide information about lines of code”. Comments ka use hum program ki readability ko badane ke liye karte hai.
Ye program ko explain karte hai or program ko samjhne me hamari help karte hai. Comments ko hum delimiters /* example */ ke andar likhte hai. Ya fir hum statements ke starting main double slash lagakar bhi kar sakte hai. Jaise ki main aapko pahle bhi bata chukka hun ki program main hum kisi bhi jagah comments ko likh sakte hai.
But hum eak string constants & character constants ke sath kisi comments ko nahi likh sakte hai. Eak program ke andar hum one more then comments ka bhi use kar sakte hai.
Types To Comments In C++ In Hindi
Comments in C++ yani ki C++ language me comments two types ke hote hai.
- Single line comments
- Multi line comments
Ab neeche hum in comments ke bare me details me padege ke ye single line or multiline comments kya hote hai.
Single Line Comments In C++ In Hindi
Single line comments ke help se hum sirf kisi eak line ke code ko he commented kar sakte hai. Yah comment double slash ( \\ ) se represent kiya jata hai.
Example of single line comments
1 2 3 4 5 6 7 |
#include <iostream> using namespace std; int main() { int x = 35; // this is sinle line comments cout<<x<<"\n"; } |
Output
35
Multiple Line Comments In C++ In Hindi
Multiple line comments ke help se hum eak sath one more then statements ke code ko he commented kar sakte hai. Yani ke eak sath bahut sari line ko commented kar sakte hai. Yah comment slash asterisk (\* Example *\ ) se represent kiya jata hai.
Example of Multiple line comments
1 2 3 4 5 6 7 8 9 |
#include <ostream> using namespace std; int main() { /* x is a variable this is multiple lines comments */ int x = 35; cout<<x<<"\n"; } |
Output
35
Related Lecture
- How To Write C++ First Program
- Difference Between C & C++ In Hindi
- What Is Constants In C++ In Hindi
Dear Students, main aasha karta hun ki aapko Comments In C++ Ka Lecture padh kar samjh me aa gaya hoga ki C++ language main comments kaise karte hai. Yadi aapako (Comments In C++) ke Lecture se related koi bhi problem hai to aap hume comment karke puch skte hai.
Leave a Reply