non, car ca signifie simplement que la variable pourra pas être modifé, hors, lors de l´allocation, c´est pas une question de variable constante ou pas, mais il doit s´agir bien d´un nombre.
Exemple :
int test_table(int x, int y)
{
int (*table)[4] = new int[x][4];
table[2][3]=2;
return table[2][3];
}
int main(void)
{
cout << test_table(3,4) << endl;
system("PAUSE");
}
Ce code marche parfaitement, hors si tu fait ta fonction test_table ainsi :
int test_table(int x, const int y)
{
int (*table)[4] = new int[x][y];
table[2][3]=2;
return table[2][3];
}
Ta variable y sera bien constante, mais ton allocation échouera et t´affichera la même erreur que si y n´était pas constant...
La profonde raison, je crois pas la connaitre 