Please help me answer these questions 1 C introduces two new

Please help me answer these questions.

1. C++ introduces two new uses for the static keyword when applied to classes: _________________ variables, and _________________.

2. It is better to think of static members as belonging to the _________________ itself.

3. Because static member variables are not part of the individual objects, you must explicitly define the __________________ if you want to initialize it to a non-zero value.

4. List an important use of static member variables_______________________________________.

5. A __________________ is a function that can access the private members of a class as though it were a member of that class.

6. To declare a friend function, simply use the _________________ keyword in front of the prototype of the function you wish to be a friend of the class.

7. If you want two _________________to be friends of each other, both must declare the other as a friend.

8. Class prototypes serve the same role as ___________________________ -- they tell the compiler what something looks like so it can be used now and defined later.

Solution

1.C++ introduces two new uses for the static keyword when applied to classes: Static variables in functions,static class objects satic member variables in class and static class objects.

2. It is better to think of static members as belonging to the class itself.

3. Because static member variables are not part of the individual objects, you must explicitly define the static members outside of the class,in the global scope if you want to initialize it to a non-zero value

4.List an important use of static member variables when we use inside the function are initialized only once, and then they hold there value even throught function calls.

5.A Friend is a function that can access the private members of a class as though it were a member of that class.

6. To declare a friend function, simply use the Friend keyword in front of the prototype of the function you wish to be a friend of the class

7.If you want two Private /protected to be friends of each other, both must declare the other as a friend.

8. Class prototypes serve the same role as If they contain Identical statements/Information they tell the compiler what something looks like so it can be used now and defined later.

Please help me answer these questions. 1. C++ introduces two new uses for the static keyword when applied to classes: _________________ variables, and _________

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site