when I do the following I get a horrible crash
void printScore(void)
{
if (agk::GetTextExists(99) == 0)
{
agk::CreateText(99, "");
agk::SetTextColor(99, 230,230,230);
agk::SetTextDepth(99,1);
agk::SetTextAlignment(99,2);
agk::SetTextPosition( 99, 1000, 0 );
agk::SetTextSize ( 99, 50 );
}
char szText [ 256 ] = "";
sprintf ( szText, "%i",currentScore );
agk::SetTextString ( 99, szText );
delete[] szText;
return;
}
I tried putting the square brackets or not putting the square brackets.. same thing.
When I dont use the delete command the program runs fine.
The text of the crash:
Debug Assertion Failed
Expression _BLOCK_TYPE_IS_VALID(pHead -> nBlockUse)
So obviously I'm doing it wrong? Haha, any tips? I thought it seemed quite simple from the examples above, but apparently not so much?