Hello,
What are the best practices for N element known in performance, memory management, ...
struct str s1={...};
..
struct str sn={...};
struct str * str_ref_array={ &s1, .. , &sn};
int N = sizeof(str_ref_array) / sizeof(struct str *);
void f(struct str ** p){
for(int i=0; i<N; i++){
..
}
}
..
void loop(){
f (str_ref_array, n);
}
OR
#define N 1000;// N = 1000 for example
struct str str_array[N];
void f(struct str *p){
for(int i=0; i<N; i++){
..
}
}
void init(){
str_array[0]={..};
..
str_array[N-1]={..};
}
void loop(){
f (str_array);
}