class myArray{
public:
explicit myArray(int count){
this->count = count;
this->ptr = new int[count];
};
public:
explicit myArray(int count){
this->count = count;
this->ptr = new int[count];
};
~myArray(){
delete[] ptr;
};
private:
int count;
int* ptr;
};
delete[] ptr;
};
private:
int count;
int* ptr;
};
int _tmain(int argc, _TCHAR* argv[])
{
myArray obj1(10);
int a=5;
myArray obj2=5; //c2440
return 0;
}
{
myArray obj1(10);
int a=5;
myArray obj2=5; //c2440
return 0;
}
转载于:https://blog.51cto.com/148332727/112790