Ask Question
21 June, 19:51

Assuming that a program has the following string object definition, which statement correctly assigns the string literal "Jane" to the string object?

string name;

name = "Jane";

string name = {Jane};

name = 'Jane';

name = Jane;

+2
Answers (1)
  1. 21 June, 22:40
    0
    name="Jane";

    Explanation:

    In C+ + assigning a value to a string object takes the following syntax:

    String variable declaration prior to the assignment using:

    string;

    String variable assignment:

    = "";

    As per the question, the variable-name is 'name' and variable-value is 'Jane'. So the required assignment has the format:

    string name;

    name="Jane";
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Assuming that a program has the following string object definition, which statement correctly assigns the string literal "Jane" to the ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers