what is difference between static and non-static variables
Answer Posted / daxini
Static :
A static variable is defined for the class itself and exists independently of any object of that class.
non-static:
a non static variable is defined for object of the class thus it is bound to an instance of its class
| Is This Answer Correct ? | 10 Yes | 2 No |
Post New Answer View All Answers
Why do we use templates?
How is new() different from malloc()?
What's the hardest coding language?
Is c++ the most powerful language?
Describe private, protected and public – the differences and give examples.
What is a constructor in c++ with example?
What is meant by entry controlled loop? What all C++ loops are exit controlled?
A prime number is a number which is divisible only by itself and 1. Examples of the first few primes are 2, 3, 5, 7, 11. Consider writing a program which can generate prime numbers for you. Your program should read in and set a maximum prime to generate and a minimum number to start with when looking for primes. This program should be able to perform the following tasks: 1. Read the maximum number from user (keyboard input) to look for primes. The program should not return any primes greater than this number. 2. Read the minimum number from user (keyboard input) to look for primes. The program should not return any primes less than this number. 3. Generate and print out every prime number between the maximum prime and minimum number specified by the user.
what is COPY CONSTRUCTOR and what is it used for?
What are pointers, when declared, intialized to a) NULL b) Newly allocated memory c) Nothing. Its random
If a round rectangle has straight edges and rounded corners, your roundrect class inherits both from rectangle and from circle, and they in turn both inherit from shape, how many shapes are created when you create a roundrect?
Explain the difference between c++ and java.
Explain deep copy?
What is static function? Explain with an example
What is the difference between C and CPP?