#include <iostream>
using namespace std;
int main()
{
char* test = new char[5];
test[0] = 'h';
test[1] = 'e';
test[2] = 'l';
test[3] = 'l';
test[4] = 'o';
cout << test << " : " << strlen(test) << " : " << _msize(test) << endl;
int a;
cin >> a;
return 0;
}
Why is this outputting : helloýýýý««««««««þîþîþîþ : 24 : 5
I could understand the first 5 characters being random chars since they hadn't been initialized, but why are there an extra 19 characters added onto this array? strlen(test) gives 24, while _msize(test) does tell me how big it's supposed to be.