I guessed no, but this output of something like this shows it does
string s=\"\";
cout<<&s;
what is the point of having empty string
Yes, every variable that you keep in memory has an address. As for what the "point" is, there may be several:
std::string
object that is created to contain it may allocate its own character buffer for holding this data, so it is not necessarily empty either. null
string. Sometimes the distinction can be important.And yes, I very much agree with the implementation of the language that an "empty" variable should still exist in and consume memory. In an object-oriented language an instance of an object is more than just the data that it stores, and there's nothing wrong with having an instance of an object that is not currently storing any actual data.