Ask Question
9 January, 02:40

If the following code is executed:

class C { public: std::string a; int b; }; ... C c0; c0. a = "abc"; c0. b = 0; C c1 (c0) Which of the following statements is true?

A) c1. a is properly initialized, but c1. b is not.

B) c1. b is properly initialized, but c1. a is not.

C) both c1. a and c1. b are properly initialized.

D) neither c1. a nor c1. b are properly initialized.

+5
Answers (1)
  1. 9 January, 03:18
    0
    C) both c1. a and c1. b are properly initialized

    Explanation:

    When a variable is said to be initialized, it means it has been assigned a value of the particular data type declared to it. the sample code snippet shows that c1 contains the value of a and b from c0, it inherits the values of a and b, so option C) holds true.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “If the following code is executed: class C { public: std::string a; int b; }; ... C c0; c0. a = "abc"; c0. b = 0; C c1 (c0) Which of the ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers