Click here to Skip to main content
15,909,325 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionLNK2005 Error... Pin
Rizean29-Jun-08 13:52
Rizean29-Jun-08 13:52 
AnswerRe: LNK2005 Error... Pin
Stephen Hewitt29-Jun-08 15:14
Stephen Hewitt29-Jun-08 15:14 
GeneralRe: LNK2005 Error... Pin
Rizean29-Jun-08 15:24
Rizean29-Jun-08 15:24 
QuestionRe: LNK2005 Error... Pin
Mark Salsbery29-Jun-08 15:17
Mark Salsbery29-Jun-08 15:17 
AnswerRe: LNK2005 Error... Pin
Rizean29-Jun-08 15:45
Rizean29-Jun-08 15:45 
QuestionRe: LNK2005 Error... Pin
Mark Salsbery30-Jun-08 6:38
Mark Salsbery30-Jun-08 6:38 
AnswerRe: LNK2005 Error... Pin
Rizean30-Jun-08 13:54
Rizean30-Jun-08 13:54 
QuestionWhy does the line "delete [] player_data_array;" give a Debug Error Pin
tippex129-Jun-08 9:30
tippex129-Jun-08 9:30 
I'm writing a class named PlayerDataVector that contains an array of pointers to PlayerData objects (player_data_array is the pointer to the array), but theres a problem when i need to create a new larger array:

Why does the line "delete [] player_data_array;" give a Debug Error "HEAP CORRUPTION DETECTED: AFTER NORMAL BLOCK (#70) at ..."?

void PlayerDataVector::CreateAndCopyToNewArray(){
int current_array_size2 = current_array_size + 4;
PlayerData **new_player_data_array = new PlayerData*[current_array_size2];

int i;
for (i = 0; i < current_array_size; i++){
new_player_data_array[i] = player_data_array[i];
}

//PointToNULL(player_data_array, 0, current_array_size);

delete [] player_data_array;
player_data_array = new_player_data_array;

FillWithNULL(player_data_array, current_array_size, current_array_size2);
current_array_size = current_array_size2;


}
QuestionRe: Why does the line "delete [] player_data_array;" give a Debug Error Pin
Mark Salsbery29-Jun-08 9:46
Mark Salsbery29-Jun-08 9:46 
AnswerRe: Why does the line "delete [] player_data_array;" give a Debug Error Pin
tippex129-Jun-08 10:08
tippex129-Jun-08 10:08 
GeneralRe: Why does the line "delete [] player_data_array;" give a Debug Error [modified] Pin
Mark Salsbery29-Jun-08 10:15
Mark Salsbery29-Jun-08 10:15 
GeneralRe: Why does the line "delete [] player_data_array;" give a Debug Error Pin
tippex129-Jun-08 11:29
tippex129-Jun-08 11:29 
GeneralRe: Why does the line "delete [] player_data_array;" give a Debug Error Pin
Mark Salsbery29-Jun-08 11:49
Mark Salsbery29-Jun-08 11:49 
GeneralRe: Why does the line "delete [] player_data_array;" give a Debug Error Pin
tippex11-Jul-08 3:27
tippex11-Jul-08 3:27 
GeneralRe: Why does the line "delete [] player_data_array;" give a Debug Error Pin
Mark Salsbery1-Jul-08 6:35
Mark Salsbery1-Jul-08 6:35 
GeneralRe: Why does the line "delete [] player_data_array;" give a Debug Error Pin
Stephen Hewitt29-Jun-08 15:15
Stephen Hewitt29-Jun-08 15:15 
QuestionIssue with calling the MessageBox Windows API from a DLL Pin
jbf15429-Jun-08 8:19
jbf15429-Jun-08 8:19 
AnswerRe: Issue with calling the MessageBox Windows API from a DLL Pin
dave_mm04-Dec-08 10:03
dave_mm04-Dec-08 10:03 
GeneralRe: Issue with calling the MessageBox Windows API from a DLL Pin
jbf1544-Dec-08 16:23
jbf1544-Dec-08 16:23 
QuestionNetwork programming (problem)???my server software is giving connection established but my client software is giving socket init failed Pin
bodhi201629-Jun-08 6:25
bodhi201629-Jun-08 6:25 
AnswerRe: Network programming (problem)???my server software is giving connection established but my client software is giving socket init failed Pin
Mark Salsbery29-Jun-08 8:18
Mark Salsbery29-Jun-08 8:18 
QuestionNeed Help... Pin
Rozz1829-Jun-08 0:36
Rozz1829-Jun-08 0:36 
AnswerRe: Need Help... Pin
rp_suman29-Jun-08 5:00
rp_suman29-Jun-08 5:00 
AnswerRe: Need Help... Pin
Baltoro29-Jun-08 11:37
Baltoro29-Jun-08 11:37 
GeneralRe: Need Help... Pin
Rozz1830-Jun-08 11:39
Rozz1830-Jun-08 11:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.