전체 글206 [C++20] 제2장 연습문제 문제1 인치를 피트와 인치로 변환하는 프로그램을 만듭니다. 1 피트는 12 인치와 같습니다. 예를 들어, 77 인치의 입력은 6 피트와 5 인치의 출력을 생성해야합니다. 사용자에게 인치 수에 해당하는 정수 값을 입력 한 다음 변환하고 결과를 출력하라는 메시지를 표시합니다. // This program will convert inches to feet and inches. import; import; using namespace std; int main() { int inches,result, _mod; const int inches_per_feet{ 12 }; cout > inches; result = inches / inches_per_feet; _mod = inches % inches_per_feet.. 2022. 8. 20. [C++20] 시작 2022. 8. 20. 1 C++ compiler support : https://en.cppreference.com/w/cpp/compiler_support Create an empty C++ project Open project properties: Alt + Enter Go to Configuration Properties → C/C++ → Language, and set the C++ Language Standard option to Preview - Features from the Latest C++ In the same section, set Enable Experimental C++ Standard Library Modules to Yes (/experimental:module) Go to Configuration P.. 2022. 7. 28. Chapter 16-1. C++에서의 형 변환 연산 모기를 잡으려면 모기약을 써야지~ dynamic_cast: 상속관계에서의 안전한 형 변환 static_cast: A 타입에서 B 타입으로 static_cast: 기본 자료형간 변환 const_cast: const의 성향을 제거하라! reinterpret_cast: 상관없는 자료형으로의 형 변환 dynamic_cast 두번째 이야기: Polymorphic 클래스 dynamic_cast와 static_cast의 차이 bad_cast 예외 2022. 7. 21. 이전 1 2 3 4 ··· 52 다음