Question from the C++ test

What is the output of the following code? #include <iostream> #include <string> using namespace std; int main() { string s = "Hello World!"; cout << s[10]; return 0; }

Hard

Which of the following statements are true?

  1. A static data member is declared inside the class but its definition always appears outside the class.
  2. If a class has a static data member and two objects are created from this class, then each object would have its own static data member
  3. A user defined object can be declared as static data member of another class.
  4. A static member function can be called using the class name.
Author: Abha AgrawaStatus: PublishedQuestion passed 455 times
Edit
-1
Community EvaluationsNo one has reviewed this question yet, be the first!