web analytics

Object Oriented Programming

Write down some properties of static member function.

Properties of Static Member Function: Following are some properties of Static Member Function A static member function can only have access to other static data members and functions declared in the same class. A static member function can be called using the class name with a scope resolution operator instead of object name. Global functions and …

Write down some properties of static member function. Read More »

How does a static member variable or static data member differs from a non-static variable or data? Explain with an example.

Static Data Member and Difference with Non-static Data Member: In general when we declare some objects of a class, each object is allocated with memory space for each variable of the class separately under them as given below, But in the case of static data member only one memory location will be allocated and that …

How does a static member variable or static data member differs from a non-static variable or data? Explain with an example. Read More »

What is inline function? Give some uses of it.

Inline Function:Every time a function is called, it takes a lot of extra time in executing a series of instructions for tasks such as jumping to that function, saving registers, pushing arguments into the stack and returning to the calling function. Also when a function is small a large percentage of execution time may be …

What is inline function? Give some uses of it. Read More »

What is friend function? Explain the use with an example.

Friend Function: Friend functions are those functions which can access all the functions and  variables of a class though it is not a member function of that class. Actually to share a function among two or more classes friend functions are used. If it is declared so, then it will able to access all variables …

What is friend function? Explain the use with an example. Read More »

Is it possible to return an object from a function? Justify your answer with an example.

Return of an Object from a Function: Yes it is possible to return an object from a function. An object can be returned to the call of its function by another object. For the justification considering the following program, //Returning of object#include<iostream.h>class myclass{ int i; public: void set_i(int n){ i=n; /*Ln 3*/ } int get_i(){ …

Is it possible to return an object from a function? Justify your answer with an example. Read More »

Is it possible to pass an object from one function to another ─ justify from an example.

Passing Objects:An object can be used as a function argument in the following two ways, pass-by-value pass-by-reference Using the first option given above we pass the value of an object to a function where the value of the used object will not change, but only be used. Use of the second will change the object …

Is it possible to pass an object from one function to another ─ justify from an example. Read More »

What is meant by the statement #include?

#include<iostream>:This is a directive which causes the preprocessor to add the contents of iostream, which is a header file and must be added above all of a program where input/output statements has been used. We will include the header file with the statement                                                           #include <iostream> The iostream package automatically defines a variable (an …

What is meant by the statement #include? Read More »

What are the basic features of OOP (Object Oriented Programming).

Object Oriented Programming is programming concept which is focused on object rather than actions and data rather than logic. To design and to use system, OOP offers some outstanding features including the followings, Basic Features of OOP: Emphasis on data rather than procedure. Programs are divided into small parts called object. Data structures are designed …

What are the basic features of OOP (Object Oriented Programming). Read More »

RSS
Follow by Email
Scroll to Top