Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
An array problem
Message
General information
Forum:
Visual C++
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00613107
Message ID:
00613655
Views:
7
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform