I am getting a run time error when my program hits this code. I am sure the delete is causing it, I just don't see what is going wrong.
Here is the function: (FavShows is a class defined earlier)
void classInit()
{
int numOfRecs;
cout << "How many records will you enter?" << endl;
cin >> numOfRecs;
FavShows *m = new FavShows[numOfRecs];
for( int i = 0; i < numOfRecs; i++)
{
m[i].initRec();
}
for( int i = 0; i < numOfRecs; i++)
{
m[i].printRec();
}
delete m;
}
The error I receive states: the error is in dbgdel.cpp ( i assume this is a memeber of one of the libs) Expression:_BLOCK_TYPE_IS_VALID(pHead->nBlockUse)
delete [] m