일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
- c++
- javascript
- 코딩테스트
- 네트워크
- kakao coding test
- Compiler
- C
- 논리게이트
- English
- 프로그래밍
- broardcast
- Kakao
- string
- programmers
- kakao입사
- memory
- 병렬 통신
- CS50
- TCP
- logic gate
- codingtest
- DRAM
- CS
- 메모리
- network
- Ethernet
- Coding Test
- ram
- 프로그래머스
- 이더넷
- Today
- Total
Code Inside
[C++] <bits/stdc++.h> 헤더 파일 사용 본문
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 파일이 존재해야 한다.
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 파일을 사용할 수 있다.
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 |