
C++의 자료형(타입)을 확인하거나 크기가 궁금할 때는 어떻게 확인할 수 있는 지 알아보자. 결론부터 말하자면, 먼저 자료형은 헤더의 typeid()를 이용한다. 타입의 크기는 sizeof() 함수를 이용하면 구할 수 있다. 아래의 예제 코드를 보자 #include #include using namespace std; int main() { int a = 5; bool b = false; short int c = 15; double d = 25.12; cout
Programming Languages/C++ & Algorithm
2020. 10. 6. 13:36