Recently I was deleting an object and an exception would get thrown, and I have narrowed it down to the use of strcpy(). To test this, I made a simple test class that uses (basically) only strcpy() and voila, an exception.
#pragma once
class TestClass
{
public:
TestClass(char []);
~TestClass();
char teststring[];
};
It's constructor looks like this:
TestClass::TestClass(char incstring[])
{
strcpy(teststring, incstring);
printf(teststring);
}
If I run the following code:
int main(){
TestClass* test = new TestClass("Cheezit");
delete test;
}
I get a thrown exception! What is HAPPENING WITH STRCPY()??!?!?!?!
Note: The console window does print "Cheezit".