Why does this work...
string str("special_string");
string arr[10];
arr[0] = str;
while this causes a seg-fault?
string str("special_string");
string *buf = (string*)malloc(sizeof(string) * 10);
buf[0] = str; /* or *buf = str; */
Aren't both instances a by-value copy?