C++ Logo.wine
C++

what is Virtual Functions? explain with example

Virtual Functions- Virtual function is member function of a class. Virtual function is declared with the keyword virtual. Virtual function takes a different functionality in the derived class. It is used to implement run time polymorphism. For example:- #include<iostream.h> #include<conio.h> Class pixeles { public: virtual void disp() { cout<<“PIXELES CLASSES FOR BCA & MCA” ; […]

C++ Logo.wine
C++

xplain the Destructor in detail with the help of examples, in context of C++ programming.

Destructor :- it is also special member of class having same name but is defined with (tilde) ~ sign. It can be parameterised. It can’t be overloaded. It does not return a value even void. It is called automatically when delete an object. Example:- #include<iostream.h> #include<conio.h> classpix { public: pix() { cout<<“\n This is constructor”; […]

C++ Logo.wine
C++

What is constructor? Define Book class with the basic features of a book. Define the default constructor, parameterised constructor, member functions display_book_details() for displaying the details of book. Use appropriate access control specifies in this program.

What is constructor? Define Book class with the basic features of a book. Define the default constructor, parameterised constructor, member functions display_book_details() fordisplaying the details of book. Use appropriate access control specifies in this program. Constructor Constructor is a special member function of class having same name of class It is called automatically when create […]

C++ Logo.wine
C++

Explain use of any two I/O formatting flags in C++ with example.

C++ defines some format flags for standard input and output, which can be manipulated with the flags, setf, and unsetf functions. For example,  cout.setf(ios_base::left, ios_base::adjustfield);  void stream::unsetf(fmtflags flags); The function unsetf() uses flags to clear the io_stream_format_flags associated with the current stream. #include <iostream.h> main() { ios_base::fmtflags original_flags = cout.flags(); cout<< 812<<‘|’; cout.setf(ios_base::left,ios_base::adjustfield); cout.width(10); cout<< […]

C++ Logo.wine
C C++

What is Object Oriented Programming (OOP) paradigm? Explain basic concepts OOP.

Object-oriented programming (oop) is a programming paradigm that represents the concept of “object” that have data fields (attributes that describe the object) and associated procedures known as methods. An object can be considered a “thing” that can perform a set of related activities. The set of activities that the object performs defines the object’s behaviour. […]