Answers were Sorted based on User's Feedback
Answer / 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
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|
Answer / dee
they are not associated with "this" pointer since it can be
called without object.they can acees only static varibales.
|Is This Answer Correct ?||55 Yes||11 No|
Answer / khan
Static member functions give internal linkage. The function
declared as static is not visible outside the file in which
it is declared. It is not associated with "this" pointer and
it can be invoked using class name instead of depending on
individual object. It can access only static members of the
|Is This Answer Correct ?||13 Yes||4 No|
Answer / manu
Static member functions have external linkage. These
functions do not have this pointers. As a result,
They cannot access nonstatic class member data using
the member-selection operators (. or –>).
They cannot be declared as virtual.
They cannot have the same name as a nonstatic function
that has the same argument types.
They are useful as they donot have access to this pointer
and so they can be called even though the class is not
|Is This Answer Correct ?||10 Yes||2 No|
Answer / 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|
Answer / sumanta pattanayak
static function is used to call static variable or class
variable...rather than that without creating the class
object we can access the static function by
classname.staticfunctionname.....THIS cannot be used inside
|Is This Answer Correct ?||6 Yes||1 No|
Answer / reejusri
Static function is basically used in creating factory
You can make your constructor private and expose static
function. And user can use the static methods to create the
object of that class.
Using NONSHARABLE_CLASS you can restrict the usage of
static functions/method also.
|Is This Answer Correct ?||15 Yes||16 No|
Answer / amit
What i think , static functions are used with the conditions
where there is no need to occupy RAM memory unnecessarily.
As ,other than Static functions are attached with the object
and ready to use memory space as and when a object of that
class is instantiated.But Static functions are having only
one address as they are independent of Objects.
|Is This Answer Correct ?||4 Yes||7 No|
Answer / sanish joseph
If we r using Static functions all the objects will get only
a single copy of dat function,means der wil b only one copy
of dat function.
static functions will contain only static variables.
|Is This Answer Correct ?||17 Yes||27 No|
Answer / priya
static word meaning it cannot be changed.so when we use
static in the function it cannot be changed
|Is This Answer Correct ?||6 Yes||73 No|
You have to take 2 arrays of length 10. Input the values of array 1 from the user. Then copy the values of array 1 to array 2 in ascending order For example if user enters 9, 5, 6, 8, 1, 0, 2, 7, 4, 3 then copy the smallest element i.e. 0 first followed by 1, 2 and so
Write the program form Armstrong no in c++?
How many bit combinations are there in a byte?
what are the iterator and generic algorithms.
what is polymorphism?
Can we have "Virtual Constructors"?
When the design recommends static functions?
How do you import payscale data from non SAP to SAP?is it through LSMW or any other way is there?
how to explain our contribution in the project?
Snake Game: This is normal snake game which you can find in most of the mobiles. You can develop it in Java, C/C++, C# or what ever language you know.
difference between macro and function?