목록전체 글 (103)
배움 저장소
자료형 리터럴(Literal) : 적어놓은 그대로가 값이다. char c = 'a'; // 이 때 'a'가 literal 변수(Variable) : 변수 이름 그리고 변수이름이 가리키는 메모리 공간 형변환 double > int int i = 987.654; 위 i 값을 출력하면 987. C++표준에서 double > int 형변환은 버림한다. double > float float f = 567.89; double 값을 float로 형변환 하였다. 불리언 cout

프로그램의 작동 과정 Stack : 프로그램 실행시 미리 할당하는 공간으로 저장용량이 정해져있다. Heap : 프로그램에 사용할 공간으로 저장용량이 정해져있지 않아 확장 가능하다 Data Text : 프로그램 코드, CPU에게 명령을 내린다. Memory Layout in C++ Memory Management In OS medium.com 헬로우 월드 printf vs cout cout(character out)이 더 편리하다. cout - 자료형 설정이 필요하지 않다. - "
https://docs.google.com/presentation/d/1nxm7jm2mGs-5uUg1G8jQU3NOgsRtdvHuxDDWWnejjLY/edit?usp=sharing 현실세계가져오기 현실 세계 가져오기 게임 엔진과 동작 탐지 기술의 활용 docs.google.com Virtual https://www.youtube.com/watch?v=GS74UD9SfV8 https://www.youtube.com/watch?v=kx0eeUU6ZbM

20.1 비쥬얼 스튜디오로 프로파일링 하기 참고자료 https://docs.microsoft.com/en-us/visualstudio/profiling/?view=vs-2019 Measure performance in Visual Studio - Visual Studio (Windows) Learn how to use Visual Studio to measure performance using profiling tools. docs.microsoft.com CPU와 Heap memory를 profiling 해보자 - 정밀한 프로그램을 만드는 경우 CPU와 Memory를 동시에 profiling하면 정확도가 떨어질 수 있다. 하나씩 하자 - Debug 모드로 실행하여 Diagnostic tool을 이용하자..

19.1 람다 함수와 std::function std::bind, for_each Lambda 익명 함수를 만들기 위하여 lambda람다를 사용한다 /* lambda [] : lambda - introducer () : lambda - parameter - declaration -> : lambda - return - type - clause {} : compound - statement */ auto lambda = [](const int&i)-> void { cout Hello World >> -11 Lamda - Capture clause - 람다 함수의 매개변수를 다양한 방법으로 설정할 수 있다. - Ampersand(&)를 사용하면 람다 함수 내에서 해당 영역에 있는 모든 변수를 참조할 수 있다..
printf vs cout ㄴprintf: c-style 입출력은 문자열과 파일을 구별한다. fprintf 함수처럼 별도의 함수를 사용한다. ㄴcout: c++은 cout으로 입출력을 모두 사용할 수 있어 편리하다. 18.1 istream으로 입력받기 cin은 문자열에서도 사용하지만 파일 입출력에서 유용하게 활용할 수 있다. 파일 읽기를 위해서 공부해보자 stream은 buffer에 저장된 자료를 꺼내오는 방식으로 동작한다. - 아래 예제를 실행해보자. 입력 문자 개수가 5개가 넘어가면 런타임 에러가 발생한다. char buf[5]; cin >> buf; cout > setw(5) >> buf; cout setw(5) >> buf; cout i >> f) cout
17.1 std::string과 std::wstring C스타일 문자열보다 편하게 사용할 수 있는 string 클래스와 wstring클래스를 소개한다 string과 wstring의 정의를 찾아가보면 아래를 확인할 수 있다. - 두 클래스 모두 basic_string 클래스를 활용하였고 템플릿 각 자료형으로 Instantiation한 결과이다. using string = basic_string; using wstring = basic_string; 이 때 w_char은 unsigned short이다. unsigned char보다 많은 문자를 다룰 수 있다. wide-character/unicode를 다룬다 wstring을 이용하여 다양한 언어를 출력해보았다 const wstring texts[] = { L..
16.1 표준 템플릿 라이브러리, 컨테이너 소개 Standard Template Libraries and Containers - STL은 Standard Template Library의 줄임말이다. Algorithms, Containers, Iterators, Functions가 있다. - STL과 Standard Library를 구분하지 않고 사용하기도 한다. - Standard Library를 특별히 공부하기 보다 필요할 때 필요한 내용을 찾아서 사용함이 현명하다. ㄴ https://en.cppreference.com/w/cpp/header Container 여러 자료형을 쉽게 다룰 수 있도록 만든 클래스로 여러 기능이 멤버함수로 구현되어있다. https://en.cppreference.com/w/c..