I want to define an 2D/3D arrays in a C++ program and pass it to a function like:
array(dim1,dim2,dim3)
function(float array,int dim1,int dim2,int dim3){
float tmp = new [dim1*dim2*dim3] ?
for (i=0;i<dim1) {
for (j=0;j<dim2) {
for (k=0;k<dim3) {
tmp(i,j,k) = array(i,j,k)...
}
}
}
}
How can I declare those arrays and how can I pass them to a function What is the best thing to do? Declare pointers?
Thanks!
array(dim1,dim2,dim3)
function(float array,int dim1,int dim2,int dim3){
float tmp = new [dim1*dim2*dim3] ?
for (i=0;i<dim1) {
for (j=0;j<dim2) {
for (k=0;k<dim3) {
tmp(i,j,k) = array(i,j,k)...
}
}
}
}
How can I declare those arrays and how can I pass them to a function What is the best thing to do? Declare pointers?
Thanks!