#include <iostream>
#include <string>
#include <stdio.h>
double get_average_massive(int32_t* m_array, uint8_t m_size_array)
{
double sum = 0.0;
for (int32_t i = 0; i < m_size_array; i++)
{
m_array[i] = i;
sum += m_array[i];
}
double m_average = sum/(double)m_size_array;
return m_average;
}
void print_average_value(double *ptr_average)
{
printf(" Average value = %lf", *ptr_average);
}
int main()
{
const uint8_t size_Array_A = 10;
int32_t Array_A[size_Array_A];
double average = get_average_massive(Array_A, size_Array_A);
print_average_value(&average);
return 0;
}
#include <stdio.h>
void printMAS (int *, int); // это для компилятора или для "имя_файла.h"
void printMAS (int *ptrA, int countptrA){
//передаем массив по указателю и количество элементов
printf ("ptrA[1] = %d\n\n", ptrA[1] );//не суть
for (int i=0; i<countptrA; ++i){
printf ("ptrA[%d] = %d\n",i, ptrA[i] );
}
}
int main(){
int B[]={5,9,10,200,500};
printf ("(sizeof(B)/sizeof(B[0])) = %d\n\n", (sizeof(B)/sizeof(B[0])) );
printMAS(B,(sizeof(B)/sizeof(B[0])));
return 0;
}