Medium
std::string::data() before and after assigning a longer string
On a typical modern implementation (libstdc++, libc++, or MSVC STL), what does this program print?
main.cpp
#include <iostream>
#include <string>
int main() {
std::string s = "short";
const char* p1 = s.data();
s = "this is a much longer string that will not fit in the small buffer";
const char* p2 = s.data();
std::cout << (p1 == p2) << std::endl;
}23 of 117 in C++