I am attempting to print some data from a class and it prints fine until he reaches the integer and then throws a heap corruption error. Can anyone explain to me why it would be doing this?
void Skill::Display(ostream& out){
char* myName = getName();
char* myDescription = getDescription();
int myLevel = getLevel();
out << " - " << myName << " -- " << myDescription << "[Lvl: ";
out << myLevel << "]" << endl; //Everything up to here is fine
}//breakpoint here and it gives me heap error.
I don’t understand why printing an int would cause a heap error.
The error is occurring in your getName() or getDescription() methods. Check for initialization problems and null pointers. See the advice from @Atimony as well. An improperly terminated string can cause problems as well.