rickiki Petit(e) nouveau(elle)
Nombre de messages : 19 Age : 37 Localisation : pas très loin mais pas trop près Fonction : concertiste à mes heures Hobbie : waar, le plus petit jeu php, et de la musique, plein... Date d'inscription : 02/05/2008
Feuille de personnage LVL: (1/1) Pts de destin: 0 XP force: 0
| Sujet: Un petit coup de main en C ? Ven 16 Mai - 2:55 | |
| Alors voila, le semestre dernier j'ai programmé un morpion avec le turbo C de Borland, seulement à un moment de mon code je veux créer une matrice qui peut avoir jusqu'à 9 dimensions et je ne sais pas comment coder ça et mon prof non plus... En même temps il est spécialisé dans l'électronique analogique donc je ne lui en veux pas. Toujours est-il que je me demandait si quelqu'un pouvais me dire ce qui ne vas pas J'ai naïvement codé comme ça - Citation :
- void confirme(mat A)
{ int a,i,j,k,l,m,n,o,p,q,ind; mat *B,*C,*D,*E,*F,*G,*H,*X,*Y; float *b,*c,*d,*e,*f,*g,*h,*x,*y;
a=vides(A);
if (a>0) {b=malloc( (a) * sizeof (float) ); B=malloc( (a) * sizeof (mat) );} if (a-1>0) {c=malloc( (a-1) * sizeof (b) ); C=malloc( (a-1) * sizeof (B) );} if (a-2>0) {d=malloc( (a-2) * sizeof (c) ); D=malloc( (a-2) * sizeof (C) );} if (a-3>0) {e=malloc( (a-3) * sizeof (d) ); E=malloc( (a-3) * sizeof (D) );} if (a-4>0) {f=malloc( (a-4) * sizeof (e) ); F=malloc( (a-4) * sizeof (E) );} if (a-5>0) {g=malloc( (a-5) * sizeof (f) ); G=malloc( (a-5) * sizeof (F) );} if (a-6>0) {h=malloc( (a-6) * sizeof (g) ); H=malloc( (a-6) * sizeof (G) );} if (a-7>0) {x=malloc( (a-7) * sizeof (h) ); X=malloc( (a-7) * sizeof (H) );} if (a-8>0) {y=malloc( (a-8 ) * sizeof (x) ); Y=malloc( (a-8 ) * sizeof (X) );} | |
|