With the implementation that I have in mind, the characters belong to a dynamically allocated array. There is a pointer member in the String object that points to the first character of this dynamically allocated array.Originally Posted by Eman
When you access s[0], it accesses s.data[0], returning it by reference. Therefore, the address of s[0] is the address of s.data[0]. Hence, if &s is equal to &s[0], then &s is equal to &s.data[0].