i am in tricky situation here , details are explained below , please guide me
there is an array like one :- [position] = element [0]=1 [1]=2 [2]=3 [3]=4 [4]=5 and so on .... please note that i didn't posted actual array(dynamic memory allocation to be precise) so elements of actual array are obviously different now the thing is i have to calculate average till each point separately like :- [0]=1 //cant be calculated for 0th position [1]=2//avg = (1+2)/2 (where 2 is total number of numbers added) [2]=3//avg = (1+2+3)/3 (where 3 is total number of numbers added), [3]=4//avg = (1+2+3+4)/4((where 4 is total number of numbers added)) [4]=5 // avg =(1+2+3+4+5)/5((where is total number of numbers added)) and so on... please note that its a dynamic memory allocation so there can be any number of times loop needs to run and load these results in separate array (dynamic memory allocation to precise ) solutions using C are preferable , C++ will work as well i've been told by dad to use #define offsetof() , that i don't understand in any case , if you want to take a look at code (which is very messy and buggy like its writer ) here is the link : https://docs.google.com/document/d/1WkH1yxi0REp5i7mLSPWuZnGcT3bzLJXwVIJmKmWZ9vU/edit?usp=sharing