Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the use of static functions?

Answer Posted / v venkatesh

The differences between a static member function and non-
static member functions are as follows.

A static member function can access only static member
data, static member functions and data and functions
outside the class. A non-static member function can access
all of the above including the static data member.

A static member function can be called, even when a class
is not instantiated, a non-static member function can be
called only after instantiating the class as an object.

A static member function cannot be declared virtual,
whereas a non-static member functions can be declared as
virtual

A static member function cannot have access to the 'this'
pointer of the class.
The static member functions are not used very frequently in
programs. But nevertheless, they become useful whenever we
need to have functions which are accessible even when the
class is not instantiated.

Is This Answer Correct ?    70 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What's the order in which the objects in an array are destructed?

1356


What is general format for a prototype?

985


Which sort is best for the set: 1 2 3 5 4 a) Quick Sort b) Bubble Sort c) Merge Sort

1016


What can I use instead of namespace std?

1083


Why was c++ made?

1051


In the derived class, which data member of the base class are visible?

1072


What is the full form nasa?

1041


Can notepad ++ run c++?

1020


Evaluate the following expression as C++ would do :8 * 9 + 2 * 5 a) 82 b) 79 c) 370 d) list

961


Define namespace in c++?

1007


Is overriding possible in c++?

961


Can char be a number c++?

1002


What are the new features that iso/ansi c++ has added to original c++ specifications?

1079


What are the various oops concepts in c++?

980


Explain differences between new() and delete()?

1060