mardi 3 février 2015

Passing a multidimensional vector (matrix) to a Function in C++

In am having problems passing a multidimensonal array to a function from the main. Here is an example of the problem:



double function(int**);
int main(){
vector< vector<int> > my_vec;
double result;
result = funtion(my_vec); //it doesnt recognize the type. my vec
return 0;
}
double function(int**my_vec){
// DOES STUFF WITH THE
}


What is the correct way of passing the matrix to the function ??


Many Thanks,


Duccio


Aucun commentaire:

Enregistrer un commentaire