//�����������ķ���ֵ

//ע�� �� ��Ҫ���ؾֲ���������

//�÷� �� ����������Ϊ��ֵ

#if(0)

#include <iostream>

int& test01()
{
	int a = 10;    //�ֲ���������������е�  ջ��

	return a;
}

int& test02()
{

	static int a = 10;      //��̬���������ȫ���� �� ȫ�����ϵ������ڳ����������ϵͳ�ͷ�

	return a;

}


int main()
{
	//int& ref = test01();

	//std::cout << " ref = " << ref << std::endl;  // ��һ�ν����ȷ �� ����Ϊ���������˱���
	//std::cout << " ref = " << ref << std::endl;  // �ڶ��ν������ �� ����Ϊa���ڴ��Ѿ����ͷ�

	int& ref2 = test02();
	std::cout << " ref2 = " << ref2 << std::endl;
	
	test02() = 1000;    //��������ķ���ֵʱ���ã�����������ÿ�����Ϊ��ֵ

	system("pause");

	return 0;

}

#endif