I have an array
int arr*;
I have declared a struct
struct counter{
int index=0;
int count=0;
int *values; // array
}
and the array will have a predefined max size.
How do I "push" structs inside each index of array? I have tried to do as following:
for ( int i =0; i < max ; i ++ ){
arr[i]=counter Store_Struct;
arr[i]->values=(int *)malloc ( 2 * sizeof ( int ));
}
but this little piece of code didn't work. How can I push structures as array values?