Skip to main content

Posts

Showing posts with the label C plus TUTORIAL

IMPORTANT QUESTION DATA STRUCTURE IN C++

  PAPER 2nd QUESTION:1 WHAT IS DATA STRUCTURE? EXPLAIN DIFFERENT TYPES OF DATA STRUCTURE A data structure is a group of data elements grouped together under one name. These data elements, known as members, can have different types and different lengths. Data structures can be declared in C++ using the following syntax: struct type_name { member_type1 member_name1; Types Data Structures are:- 1. Arrays An array is a structure of fixed-size, which can hold items of the same data type. Arrays are indexed, meaning that random access is possible. An array is usually presented as a native data structure in many programming languages. However, one shall not confuse array with the list like data structures in languages like python. Let us see arrays are presented in C++; // simple declaration int array[] = {1, 2, 3, 4, 5 }; // in pointer form (refers to an object stored in heap) int * array = new int[5]; 2. Linked Lists A linked list is a sequential st...

C++ Important questions OOP's and Data Structures (Assignment Questions)

PAPER 1st QUESTION:1   Explain Features of OOP's There are a few principle concepts and features that form the foundation of object-oriented programming − Object This is the basic unit of object oriented programming. That is both data and function that operate on data are bundled as a unit called as object. Class When you define a class, you define a blueprint for an object. This doesn't actually define any data, but it does define what the class name means, that is, what an object of the class will consist of and what operations can be performed on such an object. Abstraction Data abstraction refers to, providing only essential information to the outside world and hiding their background details, i.e., to represent the needed information in program without presenting the details. For example, a database system hides certain details of how data is stored and created and maintained. Similar way, C++ classes provides different methods to the outside world without giving internal ...

Operator Overloading // In Hindi or English // C++TUTORIAL

  Operator Overloading आज हम जानेंगे Operator overloading क्या होता है:― Operator Overloading — Operator हमेशा program के datatype के साथ काम करता है। जैसे int, float, char लेकिन जब हम अपना datatype अलग से बनाते हैं, तो इसे ही हम Operator Overloading कहते हैं।       ये user define data type पे काम करता है।अथवा ये हमारे basic data type पे work करता है। In English― T he way operators work for user-defined types like objects and structures. This is known as operator overloading. For example, Suppose we have created three objects c1 , c2 and result from a class named Complex. अगर आपको ये post अच्छी लगी हो तो हमे comment कर के जरूर बताएं।

What is Virtual function in C++ // Hindi & English // C++ TUTORIAL

  VIRTUAL FUNCTION IN C++ A C++ virtual function is a member function in the base class that you redefine in a derived class. It is declared using the virtual keyword. It is used to tell the compiler to perform dynamic linkage or late binding on the function. Virtual function का use हम जब करते जब हमें दो derive class के variable की एक ही copy लेना हों। Bonus Learning— Class data member और user define data होता है। Class access करने के लिए हम object बनाते हैं। हर data member अपने object की copy रखते हैं।

What is Union Variable in C++ // Hindi & English // C++ TUTORIAL

  Union Variable A union is a user-defined type in which all members share the same memory location. This definition means that at any given time, a union can contain no more than one object from its list of members. Union same memory space को शेयर करता है। Union variable हर element के लिए अलग से space नहीं लेता है। जहाँ एक ही variable कि value declare होती है , उसे हम union variable कहते हैं।

Inline Function // Advantage or Disadvantage in Hindi or English

 "TIME SMART STUDY" में आप सभी का स्वागत है आज हम बात करेंगे C++ Program के inline function की― Inline Function— Inline function में function call replace हो जाता है function code से।     C++ provides an inline functions to reduce the function call overhead. Inline function is a function that is expanded in line when it is call. When the inline function is called whole code of the inline functions gets inserted or substituted at the point of inline function call. Advantage— Execution fast हो जाता है। Disadvantage― Program की length increase (ज्यादा) हो जाती है। Inline function limitation— अगर किसी function में हम looping का use करते हैं तो उसे हम Inline function नही बना सकते । इसमे static variable का use हम नहीं कर सकते। Function का recursion नहीं होना चाहिए। Switch or goto हम inline function में हम use नही कर सकते। HOW DOES RECURSIVE FUNCTION WORKS— INLINE FUNCTION DISADVANTAGES:-    अगर हम दो variable बना रहें हैं तो हम compile करते है तो function code को atta...

STATIC DATA MEMBER // STATIC DATA मेम्बर क्या होते हैं // C++ TUTORIAL

 "TIME SMART STUDY" में आप सभी का स्वागत है TODAY TOPIC — STATIC DATA MEMBER STATIC DATA MEMBER— Static data member class का global variable होता है, जिसको कोई भी object access कर सकता है।        A static data Member of a class is just like a global variables for this class. That is, this data member is globally available for all the objects of that class type. The static data Member are usually maintained to store values comman to the entire class. HOW TO CREATE STATIC DATA MEMBERS (I) Declaration within the class definition with static keyword. (II) Definition outside the class definition. class X { static int count; // declaration within the class : }; The definition of the above declared static Member count outside the class will be as follows: int X::count; A static data Member can be given an initial value at the time of it's definition. int x::count=0; NOTE एक class में एक से ज्यादा variable हो सकते हैं Static एक class का नाम है। Static member function वै...