What is the use of static functions?

Answer Posted / anh vu

A static function member can be used to provide utility
functions to a class. For example, with a class representing
calendar dates, a function that tells whether a given year
is a leap year might best be represented as a static
function (DateTime.IsLeapYear). The function is related to
the operation of the class but doesn't operate on particular
object instances (actual calendar dates) of the class.

Is This Answer Correct ?    15 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to access a variable of the structure?

805


What sorting algorithm does c++ use?

902


List the features of oops in c++?

800


What happens when you make call 'delete this;'?

835


Why cout is used in c++?

787


Why would you use pointers in c++?

858


What is polymorphism in c++? Explain with an example?

824


How c functions prevents rework and therefore saves the programers time as wel as length of the code ?

882


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

815


What is vector pair in c++?

977


Can c++ be faster than c?

819


What are the defining traits of an object-oriented language?

966


What number of digits that can be accuratly stored in a float (based on the IEEE Standard 754)? a) 6 b) 38 c) An unlimited number

1039


write asingle linked list which read from two list & the do the following 1 sort the prime & nonprime num (prime should be less tn nonprime) 2 each node has a prime num followd by nonprime 3 add a new node into its sutable plce 4 erase the most three duplicated non prime num 5 find the least duplicated prime num

2430


What is the use of setfill in c++?

829