Kind of selfspam but
instead ofCode:char formattedParent[256] = ""; //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...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




Reply With Quote