Live example for static function?
Live Example for static function is Singleton class.
Static Method is used and called to get the instance of
class.
class Base
(
private:
Base()
public:
static Base* GetObject() // This is a static method
};
| Is This Answer Correct ? | 4 Yes | 0 No |
What is namespace & why it is used in c++?
Evaluate the following expression as C++ would do :8 * 9 + 2 * 5 a) 82 b) 79 c) 370 d) list
Define copy constructor.
What c++ is used for?
Why c++ does not have finally?
Is there anything you can do in C++ that you cannot do in C?
How to demonstrate the use of a variable?
What are friend functions?
How can you say that a template is better than a base class?
Problem 5: Hero's Formula is A method for calculating the area of a triangle when you know the lengths of all three sides. Let a, b, c be the lengths of the sides of a triangle. The area is given by:A= pp-ap-b(p-c) | wherep= a+b+c2 | | Write a C-language code to calculate area of triangle using above method. Take the three lengths of the triangle from the user and display the area that your program calculates.
What are pointer-to-members? Explain.
Explain linked list using c++ with an example?