ALLInterview.com :: Home Page Forum9.Com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage   interview questions urls   External Links  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories >> Software >> Programming-Languages >> C++ >> C++-General
 
 


 

 
 STL interview questions  STL Interview Questions
 OOPS interview questions  OOPS Interview Questions
 C++ General interview questions  C++ General Interview Questions
Question
what is static function
 Question Submitted By :: Ekta Gupta
I also faced this Question!!     Rank Answer Posted By  
 
  Re: what is static function
Answer
# 1
Static functions are functions which can access only static 
variables and local variables.It can be called by class 
name bcoz it is specific for a class in which it is 
defined,not for any specific object of that class.It can 
not be inherited also.
 
0
Aavesh Yadav
 
  Re: what is static function
Answer
# 2
Static member functions have a class scope and they do not
have access to the 'this' pointer of the class. When a
member is declared as static, a static member of class, it
has only one data for the entire class even though there are
many objects created for the class. The main usage of static
function is when the programmer wants to have a function
which is accessible even when the class is not instantiated.
 
0
Anil Bisht
 
 
 
 
 
 
Other C++ General Interview Questions
 
  Question Asked @ Answers
 
int f() { int I = 12; int &r = I; r += r / 4; int *p = &r; *p += r; return I; } Referring to the sample code above, what is the return value of the function "f()"? a) 12 b) 15 c) 24 d) 17 e) 30 Quark2
In a class only declaration of the function is there but defintion is not there then what is that function? Hughes4
In C++ cout is: a) object b) class c) something else Lehman-Brothers10
wrong statement about c++ a)code removably b)encapsulation of data and code c)program easy maintenance d)program runs faster  8
is throwing exception from a constructor not a good practice ? Ericsson2
What is the difference between operator new and the new operator? Wipro1
In a class, there is a reference or pointer of an object of another class embedded, and the memory is either allocated or assigned to the new object created for this class. In the constructor, parameters are passed to initialize the data members and the embedded object reference to get inialized. What measures or design change should be advised for proper destruction and avioding memory leaks, getting pointers dangling for the embedded object memory allocation? Please suggest. GE3
How to avoid a class from instantiation? Symphony4
How can you quickly find the number of elements stored in a a) static array b) dynamic array ? Lucent3
Which one of the following describes characteristics of "protected" inheritance? a) The base class has access only to the public or protected members of the derived class. b) The derived class has non-public, inheritable, access to all but the private members of the base class. c) The derived class has access to all members of the base class. d) The private members of the base class are visible within the derived class. e) Public members of the derived class are privately accessible from the base class. Quark3
How to construct virtual constructor Symphony4
Is there something that we can do in C and not in C++? Patni4
How do you link a C++ program to C functions?  2
How is an Abstract Base Class(ABC) related to an "Abstract Data Type" (ADT)  2
What is the difference between method and message? HP2
How to avoid changing constant values? Symphony1
Difference between delete and delete[]? TCS2
What will happen if when say delete this ?  3
what is an array  12
What is conversion constructor? TCS1
 
For more C++ General Interview Questions Click Here 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com