Hi all,
let's say I have a string object. I can cout the string literal by just stating the name of the object or I can use the data function.
string myStringObj = "Hello World!";
cout << myStringObj;
cout << myStringObj.data();
So, why do we have a function like string::data? Surely there must be a good reason!
Thank you,