ich will ein simples Unterprogramm schreiben, dem ein 2d Array übergeben wird und das Unterprogramm soll lediglich dieses Array ausgeben. Das Programm kompiliert zwar, hat aber immer folgende Laufzeitfehler:
62 [main] test 6116 _cygtls::handle_exceptions: Exception: STATUS_ACCESS_VIOLATION 1618 [main] test 6116 open_stackdumpfile: Dumping stack trace to test.exe.stackdump
#include <stdio.h> void putmatrix(double ** A, int dim); int main(void){ double A[3][3] = { {1,2,3}, {4,5,6}, {7,8,9}}; int dim = 3; putmatrix(A,dim); return 0; } void putmatrix(double ** A, int dim){ int i = 0; int j = 0; for (i = 0; i < dim; i++){ for (j = 0; j < dim; j++){ printf("%f ",A[i][j]); } printf("\n"); } }
Danke schonmal