Здравствуйте, гость ( Вход | Регистрация )
kibsoft | Дата 10.5.2010, 19:32 |
Вот зугуглил: Цитата double myArray[3][4] = { { 1.234, 3.567, 8.90, 0.123 }, { ... }, { ... } }; double * ptrs[3] = { &myArray[0], &myArray[1], &myArray[2] }; double ** ptr2ptr = &ptrs[0]; // call function func(ptr2ptr, 3, 4); // void func(double**, int, int); Note, I passed the 3, 4, as additional arguments cause the calling function has *no* way to find the dimensions for the sample. An easier way to define and pass the original array is like that void func(double arr[][4], int outersize); which can be called func(myArray, 3); Here the called function *knows* the dimension of the inner arrays (rows) but not the dimension of the outer array. |
|
PunX | Дата 10.5.2010, 15:46 |
Здравствуйте, необходимо реализовать умножение уматриц делаю следующим образом: matrix.h
main.cpp
и получаю ошибку: error: cannot convert 'double (*)[4]' to 'double**' for argument '1' to 'void submatr(double**, double**, double**, int, int, int)' где и что я неправильно делаю? |
|
Просмотр темы полностью (откроется в новом окне) | |
Текстовая версия | Сейчас: 28.3.2024, 16:11 |