C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Tableau de chaînes à triple entrée

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ (French)
View previous topic :: View next topic  
Author Message
Mirandole
Guest





PostPosted: Sun Mar 19, 2006 3:06 pm    Post subject: Tableau de chaînes à triple entrée Reply with quote



Salut. Gros problème en C avec les tableaux à plusieurs entrée :

#include <math.h>
#include <stdio.h>
#define maxt 12
#define maxh 50

Void main(int narg, char ** argv)
{
char tabl[maxt][maxh][1][1024]; // tableaux de chaînes
1024 à triple entrée
unsigned int i, k, j;

for (i=0;i<9;i++){
k=i/3;
j=fmod(i,3);
sprintf(tabl[k][j][0],"bla%d",i);
sprintf(tabl[k][j][1],"bla%d",i); // la même chose
}

for (i=0 ; i<9 ; i++ ) {
k=i/3;
j=fmod(i,3);
fprintf(stderr,"%s\n%s\n\n" , tabl[k][j][0] , tabl[k][j][1] )
}
}

Bon, hé bien au lieu d'écrire comme espéré :
bla0
bla0

bla1
bla1

bla2
bla2
etc...


j'ai :
bla0
bla1

bla1
bla2

bla2
bla2

bla3
bla4




bref, j'y comprend rien...
Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ (French) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.