Код: Выделить всё
Input_LeoВ CFNN.cpp:
Код: Выделить всё
{
double tx_tech_variable_vec[8] = { 0 }; //I need this re-initialization // code testing: variable rates on the initial premium payment of FIB/Invest Products with a time-variable garantueed interest rate */*/
tx_tech_variable_vec[0] = 3.0; // it does not help to declare it in CFNN.H, as part of the InputLeo structure, you have to do it here before also
tx_tech_variable_vec[1] = 1.5;
DATE tx_tech_variable_dates_vec[8] = { 0, 0 }; // initialization
tx_tech_variable_dates_vec[0] = { 2026, 07 };
tx_tech_variable_dates_vec[1] = { 2032, 07 }; // assignment
j->tx_tech_variable_vec = tx_tech_variable_vec; // overwrites everything (so for each contract (subcontract?), a new vector is written to j)
j->tx_tech_variable_dates_vec = tx_tech_variable_dates_vec; // overwrites everything (so for each contract (subcontract?), a new vector is written to j)
}
Код: Выделить всё
struct Input_Leo /* input for Leo */
{
DATE calculation_date = { 2000, 0 }; // Calculation date (used for RADP as date of the payment of unexpected premium)
DATE cohortmonthly = { 2000, 0 }; //date payement prime conclusion (used in total business mode for the month of payment of yearly premiums, to know if we reached 12 months of historic of unex premiums)
int lnumcon = 0; // Contract number
int cregfsc = 0;
and so on...
double* tx_tech = nullptr; // pointer on Tx_res_LEO to allow for dynamic memory allocation, depending on the number of subcontracts
double tx_tech_variable_vec[8] = {0};
DATE tx_tech_variable_dates_vec[8] = {0, 0}; /* code testing not sure I need to add it here */
};
Код: Выделить всё
Line Severity Code Description Project File Suppression State
4681 Error C3863 array type 'double [8]' is not assignable CF_2012_V7 C:\Users\U03630\Source\Repos\ctool\Main\code\CFNN.CPP
Line Severity Code Description Project File Suppression State
4682 Error C3863 array type 'DATE [8]' is not assignable CF_2012_V7 C:\Users\U03630\Source\Repos\ctool\Main\code\CFNN.CPP
Кроме того, элементы должны быть совместимы с DATE (
Код: Выделить всё
div_t type). Будет ли это так, если я буду работать с std::arrayПримечание:
Да, я знаю, что это не лучший способ сделать это, но да, в программе, с которой я работаю, есть 90 000 строк кода, которые уже используют эту структуру DATE и этот способ работы с массивами. Поэтому, просто добавив несколько строк кода, я не буду вводить векторы, избавляться от макросов или придумывать другой тип DATE, который не совместим с остальным (действительно очень сомнительным) кодом.
Подробнее здесь: https://stackoverflow.com/questions/784 ... -structure
Мобильная версия