pass a main matrix

Good night people! I'm trying to pass a main matrix for calc.cpp and I create calc.hpp but does not compile Someone understand this procedure? Thank you very much in advance! following codes: I used dev C ++

main.cpp
#include <iostream>
#include "calc.hpp"
using namespace std;
int main(){
    double **vetor;
    int lin = 3;
    int col = 8;
    for ( int i = 0; i < lin; i++ ){
        for ( int j = 0; j < col; j++ ){
            vetor[i][j] = 3;            
        }        
    }
    calc(vetor, lin,col);  
    
    for ( int i = 0; i < lin; i++ ){
        for ( int j = 0; j < col; j++ ){
            cout<<vetor[i][j]<<"\t";            
        }    
        cout<<endl;    
    }
}
calc.cpp
#include <iostream>
#include <fstream>
#include <sstream>
#include <stdlib.h>
using namespace std;
void calc (double **lista, int & linha, int & coluna) {     // recebe os agumentos
    for ( int i = 0; i < linha; i++ ){
        for ( int j = 0; j < coluna; j++ ){
            lista[i][j] *= 10;    
        }    
    }
}
calc.hpp
#ifndef CALC_H
#define CALC_H
void calc(double **lista, int & linha, int & coluna);         // protótipo da função
#endif //CALC_H
Topic archived. No new replies allowed.