Pointer auf array
-
Hallo
ich möchte gerne ein 2 dimensionales array per pointer an eine funktion übergeben.
Aber wie mach ich das?double k_T[3][3]; Vektor_Multiplikation (k_T); //aufruf //Funktionsprototyp void Vektor_Multiplikation (double*);
Was mach ich da Falsch?
Ich bekomm immer folgenden Fehler
line 60: argument #1: different levels of indirection
-
-
danke
double k_T[3][3]; //aufruf Vektor_Multiplikation (k_T); //deklaration void Vektor_Multiplikation (double a[][3]) { a[0][0]=0;} //prototyp void Vektor_Multiplikation (double [][3]);
gruß
-
Tu dir einen Gefallen und benutz irgendwas symbolisches anstelle der im Programm verstreuten 3.
#define DIM_X (3) #define DIM_Y (3)
-
....
nun möchte ich auch noch gerne eine array als Rückgabe wert haben.
das funzt auch nicht richtigdouble k_T[DIMX][DIMY]; double k_ist[3]; //aufruf k_ist=Vektor_Multiplikation (k_T,k_ist); //deklaration double* Vektor_Multiplikation (double m[][DIMY],double v[]) { a[0][0]=0;} //prototyp double* Vektor_Multiplikation (double [][DIMY],double[]);