Open ID와 Recaptcha가 당분간 지원되지 않습니다. 새 버전의 PHP에서 해당 확장기능이 제대로 작동하지 않습니다. 최대한 빨리 복구해보겠습니다.

상속

세그멘테이션 폴트

여러분의 도움이 필요합니다!!
이 문서는 미완성된 상태입니다. 괜한 수고를 들여 남 좋은 일 할 시간이 없다구요? 혹시 압니까? 쿠글 같은 전우주적 울트라 메가숑 기업에서 당신이 쓴 글을 보고 반해 "제발 쿠글CEO가 되어 주십시오!"라며 백지수표를 내놓을지도 모릅니다.


#include <iostream>
using namespace std;
 
class Window 
{
public: 
	Window()
	{
		Create();
	}
 
	virtual ~Window()
	{
		Destroy();
	}
 
	virtual void Create() 
	{ 
		cout << "Base class Window" << endl; 
	}
 
	virtual void Destroy() 
	{ 
		cout << "Base class Destroy" << endl; 
	}
};
 
class CommandButton : public Window 
{
public: 
	void Create() 
	{ 
		cout << "Derived class Command Button" << endl; 
	}
 
	void Destroy() 
	{ 
		cout << "Derived class Destroy" << endl; 
	}
};
 
int _tmain(int argc, _TCHAR* argv[])
{
	Window *x, *y;
	x = new Window();
	x->Create();
	y = new CommandButton();
	y->Create();
 
	delete x;
	delete y;
	return 0;
}

질문 1

위의 코드의 출력값을 예상해보고 왜 그런 결과가 나오는지 설명해보라.



재훈이의 공간