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

What are the advantages of using typedef in a program?

642


When to use “const” reference arguments in a function?

583


What are pointer-to-members? Explain.

636


How do you remove an element from a set in c++?

582


What is prototype for that c string function?

692






Is linux written in c or c++?

557


In which header file does one find isalpha() a) conio.h b) stdio.h c) ctype.h

683


What is a dll entry point?

563


If dog is a friend of boy and boy is a friend of house, is dog a friend of house?

555


Why is null pointer used?

684


What is #include sstream?

624


How do I exit turbo c++?

587


What do you understand by pure virtual function? Write about its use?

583


What is the use of bit fields in structure declaration?

544


Is arr and &arr are same expression for an array?

585