What happens when you attempt to compile and run the following code?
#include
using namespace std;
class BaseC
{
int *ptr;
public:
BaseC() { ptr = new int(10);}
BaseC(int i) { ptr = new int(i); }
~BaseC() { delete ptr; }
void Print() { cout << *ptr; }
};
int main()
{
BaseC *o = new BaseC(5);
o?>Print();
}
Lanie
3 months agoRodrigo
2 months agoLeah
2 months agoPamella
3 months agoDonte
4 months agoValentin
3 months agoWeldon
3 months agoKayleigh
3 months agoMelinda
4 months agoChantell
2 months agoMarguerita
2 months agoDorsey
2 months agoYuette
3 months agoJillian
3 months agoMicaela
3 months agoLawrence
3 months agoLai
4 months agoNguyet
4 months agoSharen
4 months agoCandra
3 months agoMary
3 months agoLai
4 months agoBrynn
4 months agoEden
3 months agoVan
3 months agoLeana
4 months ago