본문 바로가기
728x90

전체 글163

PlatformIO version 확인 PlatformIO 버전을 확인하려고 했는데, PlatformIO Home이라는 애의 버전과 PlatformIO Core라는 애의 버전 두 가지가 존재했다. PlatformIO Home과 PlatformIO Core의 차이점에 대해 찾아봤다! PlatformIO Home은 간단하게 User Interface다. PlatformIO의 여러 가지 기능을 편하게 사용할 수 있게 해주는 프로그램이다. PlatformIO Core와 PlatformIO IDE는 PlatformIO Home에 빌트인 되어 있는 기능들이다. 결론적으로 PlatformIO Home은 PlatformIO Core와 PlatformIO IDE을 포함하고 있다. https://docs.platformio.org/en/latest/home/i.. 2022. 3. 11.
CPP 부모클래스에서 virtual 함수가 하나라도 있으면 소멸자도 무조건 virtual? cpp 공부를 하며 여러 가지 테스트를 진행 중, 이상한 상황을 발견했다! class A { A() {}; ~A() {}; virtual void test1() {}; }; class B : A { } int main() { A a = new B(); delete a; } 위와 같이 코드를 적었을 때 컴파일 오류가 난다. 원래 업 캐스팅을 할 때는 자식 클래스의 소멸자가 호출되지 않기 때문에 부모 클래스의 소멸자를 virtual로 설정해서 가상 함수 테이블을 만들어 줘야 된다. 부모 클래스의 소멸자를 virtual로 설정하는 것이 좋다~이지 필수는 아니라고 알고 있어서 위의 코드에서 컴파일 오류를 마주했을 때 왜 오류가 뜨는지 몰랐다. 밑에 코드와 같이 A class(부모)에서 virtual 함수가 없으.. 2022. 3. 10.
leetcode 2) Add Two Numbers LV. Medium 🧐 https://leetcode.com/problems/add-two-numbers/ Add Two Numbers - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains.. 2022. 3. 10.
leetcode 799) Champagne Tower LV. Medium 🧐 https://leetcode.com/problems/champagne-tower/ Champagne Tower - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 We stack glasses in a pyramid, where the first row has 1 glass, the second row has 2 glasses, and so on until the 100th row. Each glass holds one cup of .. 2022. 3. 4.
leetcode 338) Counting Bits LV. Easy 😎 https://leetcode.com/problems/counting-bits/ Counting Bits - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 Given an integer n, return an array ans of length n + 1 such that for each i (0 2022. 3. 1.
leetcode 228) Summary Ranges LV. Easy 😎 https://leetcode.com/problems/summary-ranges/ Summary Ranges - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 You are given a sorted unique integer array nums. Return the smallest sorted list of ranges that cover all the numbers in the array exactly. That is, each el.. 2022. 2. 28.
leetcode 165) Compare Version Numbers LV. Medium 🧐 https://leetcode.com/problems/compare-version-numbers/ Compare Version Numbers - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 Given two version numbers, version1 and version2, compare them. Version numbers consist of one or more revisions joined by a dot '.'. Eac.. 2022. 2. 25.
leetcode 148) Sort List LV. Medium 🧐 https://leetcode.com/problems/sort-list/ Sort List - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 Given the head of a linked list, return the list after sorting it in ascending order. Example 1: Input: head = [4,2,1,3] Output: [1,2,3,4] Example 2: Input: head = [.. 2022. 2. 24.
leetcode 133) Clone Graph LV. Medium 🧐 https://leetcode.com/problems/clone-graph/ Clone Graph - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 Given a reference of a node in a connected undirected graph. Return a deep copy (clone) of the graph. Each node in the graph contains a value (int) and a list (L.. 2022. 2. 23.
728x90