darmoor
Messages postés38Date d'inscriptionvendredi 12 septembre 2003StatutMembreDernière intervention 2 novembre 2005
-
2 juin 2005 à 18:51
darmoor
Messages postés38Date d'inscriptionvendredi 12 septembre 2003StatutMembreDernière intervention 2 novembre 2005
-
2 juin 2005 à 21:29
Bonjour tout le monde!
bon, j'ai un petit probleme de compilation au niveau d'un tableau 2D dans un prototype.
J'ai demandé à quelqu'un qui s'y connais plus que moi mais a ce niveau il ne comprend pas le probleme.
la source:
#include
#include <stdlib.h>
void achat_et_vente(int p,int* N,int o,int** o2)
{
cout << "------------------------------" << endl;
cout << p << endl;
cout << "------------------------------" << endl;
for (int i2 = 0; i2 < p ;i2++)
{
cout << N[i2] << endl;
}
cout << "------------------------------" << endl;
cout << o << endl;
cout << "------------------------------" << endl;
for(int k2 = 0;k2 < o; k2++)
{
for(int l2 = 0;l2 < 2; l2++)
{
cout << o2[k2][l2] << endl;
}
cout << "------------------------------" << endl;
}
}
int main()
{
int p;
cin >> p;
if(p < 1 || p > 10000)
{
return 0;
}
int N[p];
for(int i = 0;i> N[i];
if(N[i] < 0 || N[i] > 1000)
{
return 0;
}
}
int o;
cin >> o;
if (o < 0 || o > 300000)
{
return 0;
}
int o2[o][2];
for(int k = 0;k < o; k++)
{
for(int l = 0;l < 2; l++)
{
cin >> o2[k][l];
}
}
achat_et_vente(p,N,o,o2);
system("PAUSE");
return 0;
}
et l'erreur:
cannot convert `int ( * )[2]' to `int**' for argument `4' to `void achat_et_vente(int, int*,int,int**)'