![]() |
Здравствуйте, гость ( Вход | Регистрация )
![]() ![]() |
![]() |
PunX |
![]()
Сообщение
#1
|
Студент ![]() Группа: Участник Сообщений: 56 Регистрация: 12.4.2009 Из: Димитровград Пользователь №: 676 Спасибо сказали: 0 раз(а) Репутация: ![]() ![]() ![]() |
Здравствуйте, необходимо реализовать умножение уматриц делаю следующим образом:
matrix.h
main.cpp
и получаю ошибку: error: cannot convert 'double (*)[4]' to 'double**' for argument '1' to 'void submatr(double**, double**, double**, int, int, int)' где и что я неправильно делаю? Сообщение отредактировал PunX - 10.5.2010, 15:52 |
|
|
kibsoft |
![]()
Сообщение
#2
|
Участник ![]() ![]() Группа: Участник Сообщений: 180 Регистрация: 21.7.2009 Из: Самара Пользователь №: 928 Спасибо сказали: 14 раз(а) Репутация: ![]() ![]() ![]() |
Вот зугуглил:
Цитата 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. |
|
|
![]() ![]() ![]() |
![]() |
|
Текстовая версия | Сейчас: 13.4.2025, 3:35 |