hi I recently imagined a model of parameter-based argument sending worrying about how I deal with memory management.
so I want your some opinions.
struct STD_PARAM
{
int num_param[5] ;
char str_param[10] ;
....
};
struct STD_PARAM fordata_param ;
void func_a ()
{
int data0 = fordata_param.num[0] ;
int data1 = fordata_param.num[1] ;
...
}
void func_b ()
{
int foradd = fordata_param.num[0] ;
int formultiple = fordata_param.num[1] ;
....
}
2. all functions should have a consistent rule for using parameter of course all rules should explicate their purposes manifestly.
so I can get some concludes
1) consecutively defined ( assigned / released ) data can be avoided.
2) all functions can freely get data ( return data use pointer or direct return )
3) this can cause many confusions of purpose occasionally
I'll wait your some opinions hopefully.