>Blueprint of the car is class, the car is an object, (color, number of doors) are like data members, and (accelerator and brake) are like a member function.
>Features of OOPS are object, class, data abstraction and encapsulation, information hiding, inheritance, and polymorphism.
>Wrapping up of member functions and data members inside the class is called encapsulation.
>Abtraction means showing only important details and hiding rest.
>Information hiding is like a programmer will be able to use the members of the class without knowing what it does.
>when objects of one class acquire the properties of objects of another class it is called inheritance. It provides reusability and expandability.
>C++ polymorphism means that a call to a member function will cause a different function to be executed depending on the type of object that invokes the function.
>
-----------------------------------------------------------------------------------------------------------------
>
>void keyword indicates an absence of data. we cannot declare a variable of the void type.
>c++ modifiers are signed, unsigned, short and long
>Data types which are derived from the fundamental data types are called derived data type.
>The size of the void pointer varies from system to system. If the system is 16-bit, the size of a void pointer is 2 bytes. If the system is 32-bit, the size of the void pointer is 4 bytes. If the system is 64-bit, the size of the void pointer is 8 bytes
> the size of the empty class is 1 byte.
>
-----------------------------------------------------------------------------------------------
>Namespace is a keyword and it is used to organize code into diff groups for preventing name conflicts in large projects.
>
>
>with the help of using namespace std; we can import properties of the namespace in the local scope.
>namespace can't use access modifiers
>
------------------------------------------------------------------------------------------------
>Class specification has two types: class declaration(type and scope of its members) and class function definition(how functions are implemented)
>Memory is allocated to object when they are defined.
>Members functions that are used to access private data members of that class are called Accessor or mutator methods or getter and setter functions.
>
---------------------------------------------------------------------------------------------
>Different classes can have the same name of member functions.
>member functions defined inside a class are by default inline functions.
>If data is private it can only be accessed by the members of its class and its friends(friend functions of that class).
>If data is protected then it can be accessed by the class which is derived by the class of which it is a part.
>
and is functions belonging to the class
---------------------------------------------------------------------------------------------------------
>
---------------------------------------------------------------------------------------------------------
>Inline functions are like preprocessors macro, which is copied everywhere during compilation.
>it should be small, it increases efficiency, if we define the function outside the class then it is not inline.
>
>whenever an object is returned by value a temporary object is created. (class_name functionName(){})
>
>default constructors, Parameterized constructor, Copy constructor.
>Copy constructor is used to create a copy of an already existing object of a class.
>
>Copy constructor is a constructor used to initialize an object with the values of another object.
>
Comments
Post a Comment