Kind of selfspam but

Code:
char formattedParent[256] = "";
	//char *formattedParent = new char[strlen(parent)+2];
	ZeroMemory(formattedParent, strlen(parent)+2);
	cout << "Select1\n";
	sprintf(formattedParent, "[&#37;s]\r\n", parent);//this defines a parent, then next \r\n is from element
instead of

Code:
	char *formattedParent = new char[strlen(parent)+2];
	ZeroMemory(formattedParent, strlen(parent)+2);
	cout << "Select1\n";
	sprintf(formattedParent, "[%s]\r\n", parent);//this defines a parent, then next \r\n is from element
makes the program hold... anyone any idea why and better solutions? I dont wanna allocate everything into the stack, don't see why i cant allocate it to the heap and then use sprintf...