-
입출력 조작자 (Manipulator)C++ 2021. 7. 11. 02:44
입출력 조작자 ≠ 포맷 함수 (width, fill, precision, …)
cin, cout 등으로 입출력 할 때 사용
매개변수 없는 조작자 : endl, hex, dec, showbase, showpos, showpoint 등
매개변수 있는 조작자 → iomanip 필요 : setw, setfill, setprecision, setbase 등
hex 사용해서 16진수로 입력 받아 10진수로 변환하기
#include<iostream> using namespace std; int main() { int input; cin >> hex >> input; cout << input; }
'C++' 카테고리의 다른 글
find (0) 2021.08.28 map (0) 2021.07.11 stoi() - string to int (0) 2021.07.06 pair, vector (0) 2021.07.06 cin.ignore() - cin, getline 동시에 사용할 때 (0) 2021.07.06