जब हम एक c ++ program पर consider करते हैं, तो इसे objects के Collection के रूप में defined किया जा सकता है जो एक दूसरे के methods को invoking करके communications करते हैं। आइए अब briefly देखें कि एक class, object, methods और instance variable का क्या मतलब है।

  • Object − Objects में states और behaviors होते हैं।, e.g., Real life में, car एक object है। Car में attributes हैं, जैसे weight और color, और methods, जैसे drive और brake।

  • Class - एक class को एक टेम्पलेट/blueprint के रूप में describes किया जा सकता है जो उस type के object के behaviors/states का support करता है।

  • Methods − एक method basically रूप से एक behavior है। एक class में कई methods हो सकती हैं। यह उन methods में है जहां logics लिखे जाते हैं, data में manipulated किया जाता है और सभी actions को executed किया जाता है।

  • Instance Variables - हर Object के कुछ unique set of instances होते हैं , और इन्ही instance variables को values assign करके Object की state को create किया जाता है।

C++ Program Structure

किसी भी C++ program के basic syntax को समझने के लिए एक simple C++ program के इस basic और general form को देखें।

#include<header_file_name>;
return_type main()
{
   clrscr();
   // code 
   return;
}

यह एक basic C++ program का simple syntax है। Above code में function, clrscr() का used output screen को clear करने के लिए किया जाता है।

How is c++ different from other languages

C ++ एक object-oriented programming language है , और इसमें classes, inheritance, polymorphism, data abstraction और encapsulation शामिल हैं। C ++ में एक rich function library है। C ++ exception handling, और function overloading की अनुमति देता है जो C में possible नहीं है। C ++ एक powerful, efficient और fast language है।

How to save c++ program file

  1. C++ program को हम .cpp extension के साथ save करते हैं। File को save के लिए menu से select save या F2 shortcut key दबाएं।

  2. फिर extension से पहले *.cpp में एक asterisk दिखाई देगा या आप एक word देखेंगे noname.cpp को हटा दें और इसे अपनी file को अपनी desired नाम से बदल दें। e.g. पहले myfile.cpp

  3. और फिर OK press करे आपकी File respective directory में save हो जाएगी।

How to open saved file in Turbo c++

  1. Turbo c++ application open करे। और File में जाकर open पर click करे।

  2. अब जैसे ही आप open press करते हैं तो एक window दिखाई देगी जो आपके Turbo C++ file के save किए गए folder का path दिखाती है। अब उस file को open करे।

C++ Debugging

Debugging एक ऐसी process है जिसमें programmer अपने program में potential errors/bugs का पता लगाते हैं और उन्हें remove करता हैं। अब, Turbo C++ अपने community के लिए कई प्रकार की useful features provide करता है। debug करने के लिए undermentioned दिए गए steps को follow करे:

  1. Steps 1: Window Menu में जाएं और इसके नीचे watch पर click करें।

  2. Steps 2: आप अपने IDE के नीचे watch नाम का एक panel देख पाएंगे।

  3. Steps 3: इसी तरह, Window Menu से हम outout और Message का select करेंगे और फिर better view के लिए Tile पर click करेंगे।

  4. Steps 4: Debug पर जाएं, फिर Watches के अंतर्गत Add Watch चुनें (or Ctrl+F7)।

Related Topics :

Rahul Kumar

Rahul Kumar

Hi ! I'm Rahul Kumar Rajput founder of learnhindituts.com. I'm a software developer having more than 4 years of experience. I love to talk about programming as well as writing technical tutorials and blogs that can help to others. I'm here to help you navigate the coding cosmos and turn your ideas into reality, keep coding, keep learning :)

Get connected with me. :) LinkedIn Twitter Instagram Facebook

b2eprogrammers