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

Out of fgets() and gets() which function is safe to use and why?

714


Evaluate as true or false: !(1 &&0 || !1) a) True b) False c) Invalid statement

623


Differentiate between a template class and class template in c++?

621


Explain what are the sizes and ranges of the basic c++ data types?

631


What are iterators in c++?

587






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

568


Why c++ is so important?

600


A company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9 percent of their gross sales for that week. For example, a saleperson who sells $5000 worth of merchandise in a week receives $200 plus 9 percent of $5000, or a total of $650. You have been supplied with a list of items sold by each salesperson. The values of these items are as follows: Item Value A 239.99 B 129.75 C 99.95 D 350.89 Write a program that inputs one salesperson's items sold in a week (how many of item A? of item B? etc.) and calculates and displays that salesperson's earnings for that week.

3402


Can recursive program be written in C++?

623


What does the ios::ate argument do?

654


What are the different types of polymorphism in c++?

579


Explain how an exception handler is defined and invoked in a Program.

577


What language does google use?

582


program explaining feautures of c++

1908


What are the sizes and ranges of the basic c++ data types?

571