Salve a tutti, come da titolo ho dei problemi con il programma che sto cercando di scrivere.
Qui la sorgente:
Qui il gcc:codice:#include<stdio.h> #include<stdlib.h> #include<malloc.h> int main () { const int dim = 3; int i,j; double a[dim][dim]= {{1.,0.,0.},{0.,1.,0.},{0.,0.,1.}}; double *b[dim]; for (i=0;i<dim;i++){ for(j=0;i<dim;j++){ b[i][j]=a[i][j];} } return 0;}
Grazie in anticipo per l'attenzione prestata.codice:Array.c: In function `main': Array.c:9: error: variable-sized object may not be initialized Array.c:9: warning: excess elements in array initializer Array.c:9: warning: (near initialization for `a[0]') Array.c:9: warning: excess elements in array initializer Array.c:9: warning: (near initialization for `a[0]') Array.c:9: warning: excess elements in array initializer Array.c:9: warning: (near initialization for `a[0]') Array.c:9: warning: excess elements in array initializer Array.c:9: warning: (near initialization for `a') Array.c:9: warning: excess elements in array initializer Array.c:9: warning: (near initialization for `a[0]') Array.c:9: warning: excess elements in array initializer Array.c:9: warning: (near initialization for `a[0]') Array.c:9: warning: excess elements in array initializer Array.c:9: warning: (near initialization for `a[0]') Array.c:9: warning: excess elements in array initializer Array.c:9: warning: (near initialization for `a') Array.c:9: warning: excess elements in array initializer Array.c:9: warning: (near initialization for `a[0]') Array.c:9: warning: excess elements in array initializer Array.c:9: warning: (near initialization for `a[0]') Array.c:9: warning: excess elements in array initializer Array.c:9: warning: (near initialization for `a[0]') Array.c:9: warning: excess elements in array initializer Array.c:9: warning: (near initialization for `a')![]()

Rispondi quotando
