Я хочу скопировать элементы массива struct в другой с помощью memcpy. Я считаю, что это приводит к тому, что моя программа терпит неудачу по какой-то причине. Также как я могу освободить память в конце?C++ struct array copy
struct FaultCodes
{
string troubleFound;
string causeCode;
string actionCode;
string paymentCode;
string suppCode;
u_int16_t multiplier;
};
struct JobFaultInfo
{
static const size_t NUM_CODES = 5;
FaultCodes codes[NUM_CODES];
};
FaultCodes codes[JobFaultInfo::NUM_CODES];
// I have populated codes with the data.
JobFaultInfo info;
memcpy(info.codes, codes, sizeof(FaultCodes)*JobFaultInfo::NUM_CODES);
спасибо alot .. gee, как я мог этого не знать: P ... – nixgadgets