Ostream Operator Ostream Output Const Mystring Outputmystring Q37282329

ostream & operator << ( ostream& output, constmyString& outputmyString )

{

for(int i=0;i<outputmyString.myStringSize;i++)//

output<<outputmyString.Arr[i];

output<<endl;

return output;//

}

What is the difference if you us <= and also what are youreturning


Answer


if we use <= than we will iterate the outside the arraylimits which causes runtime error in the program and terminates theprogram

we are returning ostream reference

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.