Code Inside

[C++] <bits/stdc++.h> 헤더 파일 사용 본문

C++

[C++] <bits/stdc++.h> 헤더 파일 사용

HongCorin 2022. 8. 29. 18:59
반응형

Visual Studio C++ 에서 <bits/stdc++.h> 헤더 파일을 사용하는 법을 알아보자.

 

1. <bits/stdc++.h> 의 역할

 

<bits/stdc++.h> 헤더 파일은
자주 사용하는 표준 라이브러리 헤더 파일들
모두 include 해놓은 헤더파일이다.

 

 

이 헤더 파일은 gcc 계열의 compiler 에는 미리 내장되어 있지만,

visual studio 에서는 포함하고 있지 않기 때문에 수동으로 파일을 저장해줘야 사용할 수 있다.

 

 

그럼 어떻게 저장해줘야할까?

 

 

 

 

 

 

2. 라이브러리 추가 방법

 

Visual Studio 에서 <bits/stdc++.h> 라이브러리는 string, vector 처럼 기본 제공되는 라이브러리가 아니다.

때문에, 나의 라이브러리 폴더에 bits 폴더 안에 stdc++.h 파일이 존재해야 한다.

 

stdc++.h
0.00MB

 

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include

경로에 접근해서 bits 폴더를 만들고, 위 헤더파일을 bits 폴더에 저장한다.

 

※ 단, 해당 경로는 PC에 따라, Visual studio 버전에 따라 다를 수 있으니, include 파일을 경로에 bits 폴더를 생성하자.

 

stdc++.h include

 

 

이제 문제 없이 stdc++.h 파일을 사용할 수 있다.

 

 

 

 

 

 

 

3. C++ 표준 라이브러리 헤더 파일 / Standard Library headers

아래 site 를 참고하면 C++ 표준 라이브러리 헤더 파일들을 확인할 수 있다.

https://en.cppreference.com/w/cpp/header

 

C++ Standard Library headers - cppreference.com

Standard Library headers The interface of C++ standard library is defined by the following collection of headers. Concepts library Fundamental library concepts [edit] Coroutines library Coroutine support library [edit] Utilities library std::any class [edi

en.cppreference.com

 

 

 

include 가 많이 필요한 경우
다 쓰지 말고
<bits/stdc++.h> 헤더 사용해서
스.마.트한 개발자가 되어보자~!

 

'C++' 카테고리의 다른 글

C/C++ 데이터 타입(DataType) 범위  (0) 2022.09.20
[개념] Shift(쉬프트) 연산(<<, >>) - C++  (0) 2022.09.06
Comments