adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    #include <string>
    using namespace std;
    int main() 
    {
        string s = "a long string";
        s.insert(s.size() / 2, " * ");
        cout << s << endl;
        return 0;
    }

a.

a long* string

b.

a long st*ring

c.

Depends on compiler

d.

None of the mentioned

Answer: (c).Depends on compiler

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?