Article View: fr.comp.lang.c
Article #26<<<URGENT>>>Besoin savoir comment faire pour passer les arguments d'une matrice dans une procédure?
From: Julien Curto
Date: Mon, 20 Mar 2000 00:00
Date: Mon, 20 Mar 2000 00:00
207 lines
6176 bytes
6176 bytes
This is a multi-part message in MIME format.
--------------31AC71285AD7C9740C19E133
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Salut =E0 toi internaute chevron=E9 !!!
J'esp=E8re que tu pourras m'apport=E9 un soutien dans ma longue qu=EAte d=
u
C...
J'ai fais un petit programme d'importation de valeurs vers un =E9diteur d=
e
courbe, mais j'ai un petit probl=E8me pour implanter les arguments de la
matrice (valeurs x&y) dans ma proc=E9dure principale d'importation.
Programme de d'extraction de donn=E9es stock=E9es [voir pi=E8ces jointe]
stock=E9es dans un fichier [ex:*.DAT] : =
void import_read_layout( FILE *import_file_fd )
{
DPRINTF0("Starting import_read_layout()\n");
int cpt_x=3D0, cpt_y=3D0, j=3D0, nb_line=3D0;
int count =3D 0;
FILE *input_file; =
float x[3][5];
float y[3][5];
char xxx[1000];
=
=
input_file =3D fopen(*import_file_fd,"r");
=
if (input_file =3D=3D NULL)
{
printf("\nCannot open %s\n\n",*import_file_fd);
exit(8);
}
=
count=3D0; =
=
while(1)
{
xxx[count] =3D fgetc(in_file);
if (xxx[count] =3D=3D '\t')
{
strcat( xxx, "\0");
=
if (((cpt_x)-(cpt_y))%2 =3D=3D 0 )
{ =
sscanf(xxx,"%f",&x[cpt_x][j]); =
printf("x[%d][%d] =3D %f\n", cpt_x, j, x[cpt_x][j]); =
} =
else =
{ =
sscanf(xxx,"%f",&y[cpt_y][j]); =
printf("y[%d][%d] =3D %f\n", cpt_y, j, y[cpt_y][j]); =
} =
=
j++; =
count =3D -1; =
strcpy( xxx, "\0"); =
} =
=
else if (xxx[count] =3D=3D '\n') =
{ =
printf("\n");
count =3D -1; =
j =3D 0; =
=
if ((nb_line%2) =3D=3D 0) =
{
cpt_x++;
nb_line++;
}
else =
{
cpt_y++; =
nb_line++;
}
=
} =
=
else if (xxx[count] =3D=3D EOF) =
{ =
/*printf("End of File\n");*/
break; =
} =
=
count++; =
} =
DPRINTF0("Leaving import_read_layout()\n");
}
Mais lorsque je d=E9sire implenter les diff=E9rentes valeurs de x & y dan=
s
la proc=E9dure principale d'importation, je me retrouve confront=E9 au
probl=E8me :
Comment arriver =E0 passer les valeurs de x & y de la matrice de la
proc=E9dure d'extraction [voir prgm ci-dessus] quand dans la proc=E9dure
principale d'importation ce sont des doubles-ponteurs qui doivent les
recevoir ?!?!?!? [voir proc=E9dure principale d'importation ci-dessous]
void import_window( float **x, float **y, int *points, int curves )
{
DPRINTF0("Starting import_window()\n");
/* if the window does not exist, create it =
*/
if ( Import_Window =3D=3D NULL ) =
import_window_create();
/* if there is already a print window active,
*/ =
if ( import_lock < 0 )
dialog_error_window( IMPORT_WINDOW_OCCUPIED_ERROR_TEXT );
else
{
import_lock =3D -1;
gtk_widget_show_all( Import_Window );
}
=
DPRINTF0("Leaving import_window()\n");
}
J'esp=E8re que quelqu'un pourras r=E9pondre car c'est tr=E8s important po=
ur le
projet sur lequel je travail actuellemnt...
D'avance merci & bon continuation sur le Net !!!!
Julien =
Allias M=EFll#99
--------------31AC71285AD7C9740C19E133
Content-Type: image/gif;
name="projet.gif"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="projet.gif"
eFswXVswXSA9IDAuMDAwMDAwCnhbMF1bMV0gPSAwLjAwMDAwMAp4WzBdWzJdID0gMTgwLjAw
MDAwMAp4WzBdWzNdID0gMTgwLjAwMDAwMAoKeVswXVswXSA9IC01LjAwMDAwMAp5WzBdWzFd
ID0gNS4wMDAwMDAKeVswXVsyXSA9IDUuMDAwMDAwCnlbMF1bM10gPSAtNS4wMDAwMDAKCnhb
MV1bMF0gPSAwLjAwMDAwMAp4WzFdWzFdID0gMTIwLjAwMDAwMAp4WzFdWzJdID0gMTIwLjAw
MDAwMAp4WzFdWzNdID0gMzAwLjAwMDAwMAp4WzFdWzRdID0gMzAwLjAwMDAwMAoKeVsxXVsw
XSA9IC01LjAwMDAwMAp5WzFdWzFdID0gLTUuMDAwMDAwCnlbMV1bMl0gPSA1LjAwMDAwMAp5
WzFdWzNdID0gNS4wMDAwMDAKeVsxXVs0XSA9IC01LjAwMDAwMAoKeFsyXVswXSA9IDAuMDAw
MDAwCnhbMl1bMV0gPSA2MC4wMDAwMDAKeFsyXVsyXSA9IDYwLjAwMDAwMAp4WzJdWzNdID0g
MjQwLjAwMDAwMAp4WzJdWzRdID0gMjQwLjAwMDAwMAoKeVsyXVswXSA9IDUuMDAwMDAwCnlb
Ml1bMV0gPSA1LjAwMDAwMAp5WzJdWzJdID0gLTUuMDAwMDAwCnlbMl1bM10gPSAtNS4wMDAw
MDAKeVsyXVs0XSA9IDUuMDAwMDAwCgo=
--------------31AC71285AD7C9740C19E133--
Technical Details
Message-ID:
<38D6467A.1BB1E603@www.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: FRENCH,ASCII X-Google-Thread: 15191e,fd6314bfa52cb968,start X-Google-Attributes: gid15191e,public X-Google-Thread: 12ff84,fd6314bfa52cb968,start X-Google-Attributes: gid12ff84,public X-Google-Thread: f9822,b1197ff286518239 X-Google-Attributes: gidf9822,public X-Google-Thread: 112c2d,fd6314bfa52cb968,start X-Google-Attributes: gid112c2d,public X-Google-Thread: 102e15,fd6314bfa52cb968,start X-Google-Attributes: gid102e15,public X-Google-Thread: fff80,fd6314bfa52cb968,start X-Google-Attributes: gidfff80,public From: Julien Curto <mill99@www.com> Subject: <<<URGENT>>>Besoin savoir comment faire pour passer les arguments d'une matrice dans une procédure? Date: 2000/03/20 Message-ID: <38D6467A.1BB1E603@www.com> X-Deja-AN: 599978024 X-Accept-Language: en Content-Type: multipart/mixed; boundary="------------31AC71285AD7C9740C19E133" Organization: iP Technologies Mime-Version: 1.0 Newsgroups: fr.comp.lang.c,fr.comp.developpement,fr.comp.divers,besancon.test,fr.bienvenue.questions,fr.comp.lang.c++fr.education.entraide