I tried this
string *codes = (string*)malloc(256*sizeof(string));
codes[0] = "";
in C++. But it didn't work, but when I tried
string *codes = new string[256];
codes[0] = "";
This worked. I did not understand the basic idea behind why this is happening. Could someone please tell me.
Thanks