목록Study (151)
Rylah's Study & Daily Life
보호되어 있는 글입니다.

PreProcessor : 프리프로세서 - #include , #define, #ifdef, #pragma once https://en.cppreference.com/w/cpp/preprocessor Preprocessor - cppreference.com The preprocessor is executed at translation phase 4, before the compilation. The result of preprocessing is a single file which is then passed to the actual compiler. [edit] Directives The preprocessing directives control the behavior of the preprocessor..

빌드는 Preprocess, Complie, Link로 구성됨 //초기 main.cpp #include void foo() { std::cout

Build Process - 다른 언어와는 다르게 복잡한 편이다. main.cpp cat.h cat.cpp 파일들이 있다고 가정하자 빌드에서 가장 먼저 개입 되는 것은 pre-processor - #include, #define을 치환해주는 역할 cat.h main.cpp => translation unit cat.h main.cpp => Translation unit 이 Translation unit을 Compiler가 obj 파일로 변환 code data obj 이러한 obj 파일들을 링커가 개입해서 필요한 obj 파일을 모아서 실행 파일로 code data excute한 여러 정보들 프로세스가 만들어지게 된다. 이러한 프로세스를 진행 해주는 것을 컴파일러 라고 한다. 컴파일러의 종류 https://..
C++는 컴파일이 되는 언어이다. 소스코드 -> 컴파일 -> Binary Code 그리고 컴퓨터는 Binary Code를 읽어 실행 하는 구조 절대 Visual Studio에서 F5를 눌러서 하는 것이 아니다. 실제 빌드 프로세스는 Complie, Linking Process가 있다. 어셈블리, Static Library, Shared Library, Debugging Process, C++는 왜 헤더파일이 필요한지 이해할 수 없다. 지금 듣는 시점에서는 잘 모르는 부분이다. - 헤더파일이 왜 필요한가? - obj 파일이 무엇인지? - 링킹과정이 무엇인지 왜 필요한지? - obj 파일에서 static이나 extern이 가지는 의미 - 어셈블리 코드를 보며 최신 컴파일러가 어디까지 최적화를 진행하는지 확인..
Object - Objct create, new / Java -> C++ (습관적으로 new를 사용함) Modern C++ pointer -> new object. Smart Pointer use #include #include class Person { public: Person(std::string name, int age) :name(std::move(name)), age(age) {}; private: std::string name; int age; }; int main(void) { Person a("nocope", 31); // Stack에 우선시 // Person * ap = new Person(); // Heap // delete ap; std::vector people; // Heap u..
보호되어 있는 글입니다.