1. New
=> New는 C++에서 동적할당을 하기 위한 연산자
=> Hep Segment에 저장됨
=> https://merry-nightmare.tistory.com/279
[c++] new 연산자
1. Memory => 메모리에는 Code / Data / Stack / Heap 등이 존재 [https://merry-nightmare.tistory.com/264] Program이 실행 되면 PAS(Process Address Space가 Memory에 할당 => Program -> Process -> Memory..
merry-nightmare.tistory.com
2. Heap에 생성되지 않는 Class(new) 생성
=> Operator new를 오버로딩 하고, Class 내에 Public이 아닌 Private로 생성함
class A
{
private:
void* operator new(size_t size)
{
void* address = new char[size];
return address;
}
}
'C++ > Tips' 카테고리의 다른 글
[C++] Predefined Macro (0) | 2021.06.23 |
---|---|
[C++] 가변인자[variable argument] (0) | 2021.06.22 |
[C++] Union (0) | 2021.06.18 |
[c++] inline (0) | 2021.06.16 |
[C++] Casting (0) | 2021.06.15 |