对于这个程序,C++11返回2 1 2,但是对于C++14来说,它会返回给我2 1 1。我很困惑。
#include <iostream>
#include <string>
using namespace std;
int main()
{
char a[2];
cout << sizeof(a) << endl;
std::string b("a");
cout << b.size() << endl;
char c[b.size() + 1];
cout << sizeof(c) << endl;
return 0;
}