**The problem is that I cant compile due to this error:**

```
ejercicio_4.cpp: In function ‘int main()’: *
ejercicio_4.cpp:32:49: error: cannot call member function ‘void Calculos::calcular_desvtipica(double)’ without object
  P[2] = thread(Calculos::calcular_desvtipica(5.0), p3);

```

Here is **Calculos.h**

```
#ifndef CALCULOS_H
#define CALCULOS_H
#include <iostream>
#include <string>
#include <chrono>
#define N 100
using namespace std;

class Calculos {
public:
    Calculos(double T[], int op);  
    Calculos(); 
    void run();
    void calcular_desvtipica(double media);

    double *T;
    int op;
    double max, min, desvtipica, media;
};
#endif

```

**Calculos.cpp**

```
#include <iostream>
#include <string>
#include <chrono>
#include "Calculos.h"
using namespace std;

Calculos::Calculos(double T[], int op) { 
    this->T = T;
    this->op = op;
};

Calculos::Calculos() { }

void Calculos::run() {
    if(op == 1) {   //calcular media
        double suma = 0.0;
        for(int i = 0; i < N; i++) {
            suma = suma + T[i];
        }
        media = (double)(suma/N);
    }
    else if(op == 2) {  //calcular maximo y minimo
        double datoMax = T[0], datoMin = T[0];
        for(int i = 1; i < N; i++) {
            if(T[i] > max) max = T[i];
            if(T[i] < min) min = T[i];
        }
        max = datoMax;
        min = datoMin;
    }
    else {  //op=3 calcular desviacion tipica
        cout << "que cojones hago aqui" << endl;
    }
};

void Calculos::calcular_desvtipica(double media) {
    desvtipica = media/2.0;
};

```

**Here is the main method**

```
#include <iostream>
#include <thread>
#include <string>
#include <chrono>
#include "Calculos.h"
using namespace std;

int main() {
    double T[N];
    for(int i = 0 ; i < N; i++) {
        T[i] = (double)rand();
    }

    thread P[3];

    Calculos p1(T, 1),
             p2(T, 2),
             p3(T, 3);
    P[0] = thread(&Calculos::run, p1);
    P[1] = thread(&Calculos::run, p2),
    P[0].join();
    double m = p1.media;
    P[2] = thread(Calculos::calcular_desvtipica(m), p3);
    P[1].join();
    P[2].join();

    cout << "#datos: " << N << endl;
    cout << "media: " << p1.media << endl;
    cout << "min: " << p2.min << endl;
    cout << "max: " << p2.max << endl;
    cout << "sigma: " << p3.desvtipica << endl;

    cout << "Fin\n";
    return 0;
}

```

I try to change this line: 

```
P[2] = thread(Calculos::calcular_desvtipica(m), p3);

```

to: 

```
P[2] = thread(p3.calcular_desvtipica(m), p3);

```

but it doesn't work. Where is the problem?