Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
An array problem
Message
Information générale
Forum:
Visual C++
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00613107
Message ID:
00613236
Vues:
9
>If I have a global int NumFields, and need to create an array of that size, I require a constant. Here's what I have at the moment.
>
>const int ArraySize = (const int)NumFields;
>Element TempSchema[ArraySize];
>
>This, of course, does not work. "expected constant expression"
>
>Any suggestions ?

Element *TempSchema = new Element[NumFields] ;

.....

delete TempSchema ;
Len Speed
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform