C언어 > printf Substitution Types

TODAY1,416 TOTAL2,701,321
사이트 이용안내
Login▼/회원가입
최신글보기 질문게시판 기술자료 동영상강좌

아두이노 센서 ATMEGA128 PWM LED 초음파 AVR 블루투스 LCD UART 모터 적외선


BASIC4MCU | C언어 | C언어 | printf Substitution Types

페이지 정보

작성자 master 작성일2018-02-05 23:42 조회2,175회 댓글0건

본문

 

Type field[edit]

The Type field can be any of:

CharacterDescription
%Prints a literal % character (this type doesn't accept any flags, width, precision, length fields).
diint as a signed decimal number. %d and %i are synonymous for output, but are different when used with scanf() for input (where using %i will interpret a number as hexadecimal if it's preceded by 0x, and octal if it's preceded by 0.)
uPrint decimal unsigned int.
fFdouble in normal (fixed-point) notation. f and F only differs in how the strings for an infinite number or NaN are printed (infinfinity and nan for fINFINFINITY and NAN for F).
eEdouble value in standard form ([-]d.ddd e[+/-]ddd). An E conversion uses the letter E (rather than e) to introduce the exponent. The exponent always contains at least two digits; if the value is zero, the exponent is 00. In Windows, the exponent contains three digits by default, e.g. 1.5e002, but this can be altered by Microsoft-specific _set_output_format function.
gGdouble in either normal or exponential notation, whichever is more appropriate for its magnitude. g uses lower-case letters, G uses upper-case letters. This type differs slightly from fixed-point notation in that insignificant zeroes to the right of the decimal point are not included. Also, the decimal point is not included on whole numbers.
xXunsigned int as a hexadecimal number. x uses lower-case letters and X uses upper-case.
ounsigned int in octal.
snull-terminated string.
cchar (character).
pvoid * (pointer to void) in an implementation-defined format.
aAdouble in hexadecimal notation, starting with 0x or 0Xa uses lower-case letters, A uses upper-case letters.[3][4] (C++11 iostreams have a hexfloat that works the same).
nPrint nothing, but writes the number of characters successfully written so far into an integer pointer parameter.
Java: indicates a platform neutral newline/carriage return.[5]
Note: This can be utilized in Uncontrolled format string exploits.

https://en.wikipedia.org/wiki/Printf_format_string 

 

댓글 0

조회수 2,175

등록된 댓글이 없습니다.

C언어HOME > C언어 > 전체 목록

C언어 목록
제목 작성자 작성일 조회
125 C언어 Timeline of programming languages 이미지 master 18-09-05 3393
124 C언어 printf format string - 위키 백과 이미지 master 18-08-24 2702
현재글 C언어 printf Substitution Types master 18-02-05 2176
122 C언어 Escape sequence master 18-02-05 2186
121 운영체제 없는 프로그래밍 강좌 [펌] qt로 프로그램 만들기 강좌 채팅 서버와 클라이언트 키트 17-09-12 2979
120 운영체제 없는 프로그래밍 강좌 [펌] qt로 프로그램 만들기 강좌 - 서버 키트 17-09-12 2188
119 운영체제 없는 프로그래밍 강좌 [펌] qt로 gui 프로그램 만들기 강좌 - 파일 열기 타이머 키트 17-09-12 2482
118 운영체제 없는 프로그래밍 강좌 [펌] qt로 gui 프로그램 만들기 강좌 - 미로 탈출 키트 17-09-12 2059
117 운영체제 없는 프로그래밍 강좌 [펌] qt로 gui 프로그램 만들기 강좌 - 미로 맵 출력 키트 17-09-12 2490
116 운영체제 없는 프로그래밍 강좌 [펌] qt로 gui 프로그램 만들기 강좌 - 그림띄우기와 충돌처리 키트 17-09-12 2007
115 운영체제 없는 프로그래밍 강좌 [펌] qt로 gui 프로그램 만들기 강좌 - 오늘의 유머 랜덤 베오베 글 키트 17-09-12 2053
114 운영체제 없는 프로그래밍 강좌 [펌] qt로 gui프로그램 만들기 강좌 - 더하기 출력 키트 17-09-12 3599
113 운영체제 없는 프로그래밍 강좌 [펌] 운영체제 없는 프로그래밍 강좌 문자열 출력 키트 17-09-12 1960
112 운영체제 없는 프로그래밍 강좌 [펌] 운영체제 없는 프로그래밍 강좌 문자 1개 출력 키트 17-09-12 1968
111 운영체제 없는 프로그래밍 강좌 [펌] 운영체제 없이 화면에 점찍기 키트 17-09-12 2393
게시물 검색

2022년 1월 2월 3월 4월 5월 6월 7월 8월 9월 10월 11월 12월
2021년 1월 2월 3월 4월 5월 6월 7월 8월 9월 10월 11월 12월
2020년 1월 2월 3월 4월 5월 6월 7월 8월 9월 10월 11월 12월
2019년 1월 2월 3월 4월 5월 6월 7월 8월 9월 10월 11월 12월
2018년 1월 2월 3월 4월 5월 6월 7월 8월 9월 10월 11월 12월
Privacy Policy
MCU BASIC ⓒ 2020
모바일버전으로보기