Debug Assertion Failed. directly after exiting a member function (as I saw with step-into), happening I think in this part of my code:
//error happens right here, which is called upon leaving main().}
The ch is a private char pointer in the drinksAtWork class.
There is only one member function which has only cout and cin.
What is wrong?
of Zen Hall
allocates space for one char on the heap and returns the address in ch.
points ch at a string literal. It no longers points to the memory on the heap and you're then trying to delete memory that you haven't allocated. You could do something like
ch=new char; // for 'f','f','\0'
delete  ch;