Answer Posted / reejusri
Static function is basically used in creating factory
objects.
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 |
Post New Answer View All Answers
Explain selection sorting. Also write an example.
How does java differ from c and c++?
What are the main features of c++?
Explain what you mean by a pointer.
Difference between a copy constructor and an assignment operator.
What is exception handling? Does c++ support exception handling?
How can you link a c++ program to c functions?
find the two largest values among the 6 numbers using control structures : do-while,for,if else,nestedif- else ,while. one or two of them.
What are the types of container classes?
What are pointers, when declared, intialized to a) NULL b) Newly allocated memory c) Nothing. Its random
Is dev c++ free?
What are the advantages of using friend classes?
How to declaring variables in c++?
what are the decision making statements in C++? Explain if statement with an example?
Is there any function that can skip certain number of characters present in the input stream?