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 are the various oops concepts in c++?

1088


Explain queue. How it can be implemented?

1204


what is Loop function? What are different types of Loops?

1283


How to implement is-a and has-a class relationships?

1087


What does the ios::ate argument do?

1241


What is the v-ptr?

1216


Is it possible to pass an object of the same class in place of object reference to the copy constructor?

1101


What is the best c++ compiler for windows 10?

1092


Write a program using display() function which takes two arguments.

1125


How do you declare a set in c++?

1017


How many types of modularization are there in c++?

1124


Can non-public members of another instance of the class be retrieved by the method of the same class?

1125


What is the full form of stl in c++?

1240


Can comments be nested?

1085


Can we define a constructor as virtual in c++?

1187