class TestClass
{
private:
	int member_1;
	int member_2;
public:
	TestClass();
	TestClass(int number);
	TestClass(int number_1, int number_2);
};
TestClass::TestClass() {}
TestClass::TestClass(int number) {}
TestClass::TestClass(int number_1, int number_2) {}
class TestClass
{
	
};
TestClass::TestClass() {} // 디폴트 생성자
TestClass::~TestClass() {} // 디폴트 소멸자
// 그 어떤 생성자/소멸자라도 정의되면 컴파일러에 의해 자동으로 만들어지지 않음.
#include <array>
class TestClass
{
private:
	int number;
	bool isPrime;
	std::array<int, 5> arr;
public:
	TestClass();
};
TestClass::TestClass() : number(4), arr({ { 1, 2, 3, 4, 5 } })
{
	isPrime = false;
}
void main(void)
{
	TestClass * inst = new TestClass(2, 3);
	
	delete inst; // 소멸자를 호출
}
class TestClass
{
private:
	int privateMem;
	double privateMem_2;
// 자기 클래스에서만 접근 허용
public:
	int publicMem;
	float publicMem_2;
// 외부에서도 접근 허용
protected:
	bool protectedMem;
	bool protectedMem_2;
// 자기 클래스와 상속 받은 클래스에서만 접근 허용
};
void main(void)
{
	TestClass * arr[3] = { new TestClass(), new TestClass(1), new TestClass(2, 3) };
	TestClass * allocArr = new TestClass[10];
	delete[] allocArr;
	delete arr[1];
}
#include <string>											
       // 필요함
using namespace std;
int main(void)
{
	int startIndex = 0;
	string replaceString = string("a");
	string strInst = string("TestInstance");
	int strLength = strInst.length();						
        // strLength = 12, strInst.size()로도 가능
	strInst.append("Append");								
        // strInst = TestInstanceAppend
	char charAt = strInst.at(4);							
        // charAt = I (Zero Index 기준)
	strInst.compare("CompareMethod");
	strInst.replace(startIndex, strLength, replaceString);	
        // 기존의 문자를 덮어쓰면서 replace 하는 점에 주의.
	
	stoi(strInst);											
        // string to int (C++11)
	
	strInst.find("Search Method");							
        // 찾지 못하면 string::npos를 return.
	string itoa = to_string(3);								
        // ToString (C++11)
	strInst.clear();										
        // strInst = null
	return 0;
}
#include <initializer_list>
// 필요함
#include <vector>
using namespace std;
int AddArray(initializer_list<int> list);
int main(void)
{
	int doTest = AddArray({ 1, 2, 3, 4, 5, 6, 7, 8, 9 });
	int doTest_2 = AddArray({ 2, 3, 4, 5, 6 });
	return 0;
}
int AddArray(initializer_list<int> list)
{
	int result = 0;
	vector<int> elem = vector<int>(list.begin(), list.end());
	for (int i = 0; i < list.size(); i++)
	{
		result += elem.at(i);
	}
	return result;
}
- 명시적 디폴트/명시적으로 삭제한 생성자, 복사 생성자, 대입 연산자
 
class TestClass
{
private:
	int amount;
	double price;
public:
	TestClass() = default;
	
	TestClass(const TestClass &) = delete;
	TestClass& operator = (const TestClass&) = delete;
};
void main(void)
{
	TestClass a;
	TestClass b;
	a = b;
	// 삭제된 연산자이므로 컴파일 오류
	TestClass c(a);
	// 삭제된 복사 생성자이므로 컴파일 오류
}
// 아무 함수에도 delete를 선언하여 삭제할 수 있다. ex) 형변환
class TestClass
{
private:
	int amount;
	double price;
public:
	TestClass();
	TestClass(double price);
	TestClass(int amount, double price);
};
TestClass::TestClass() : TestClass::TestClass(1.0)
{
}
TestClass::TestClass(double price) : TestClass::TestClass(1, price)
{
}
TestClass::TestClass(int amount, double price)
{
	(*this).amount = amount;
	(*this).price = price;
}