Ah, that is a good idea.
Something like this then:
Code:
#include <iostream>
#include <cstdlib>
#include <ctime> // used for other parts of code
#include <cmath> // used fr other part of code
#include <gsl/gsl_statistics_double.h>
using namespace std;
template<typename T, int N> double foo(T data[N])
{
size_t data_size = sizeof(data); // N elements
return gsl_stats_mean(data, 1, data_size);
}
int main()
{
double k;
double mod_data[] = {4.88,3.56,3.81,4.01,2.5,3.71,4.8,5.2};
k=foo(mod_data);
cout<<k<<endl;
system("pause");
return 0;
}