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:
00613655
Vues:
8
Ah hah, found the solution ;) Thanks for the help ~

// global declares
struct Element{
char
*name,
*type,
*length,
*dec;
};
Element *Schema=NULL;
int NumFields=0;
// end globals

// code
Schema = RedimensionArray(Schema);
NumFields++;
// code

// function causing the problem
Element *RedimensionArray(Element *pOldArray){
Element *pNewArray=new Element[NumFields+1];
ASSERT(pNewArray!=NULL);
if(pOldArray!=NULL){
// copy the contents and delete the old array
for(int i=0;i pNewArray[i]=pOldArray[i];
delete[] pOldArray;
}
return pNewArray;
}
// end func
Chris Zangarine
Software Development Engineer
Pipeline Compliance System (PCS)
American Innovations
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform