원문
함수 설명
void sprintf(char *str, char flash *fmtstr [ , arg1, arg2, ...])
this function is identical to printf except that the formatted text is placed in the null terminated character string str.
In order to reduce program code size, there is the Project|Configure|C Compiler|Code Generation|(s)printf features option.
It allows linking different versions of the printf and sprintf functions, with only the features that are really required by the program.
The following (s)printf features are available:
?int - the following conversion type characters are supported: 'c', 's', 'p', 'i', 'd', 'u', 'x', 'X', '%', no width or precision specifiers are supported, only the '+' and ' ' flags are supported, no input size modifiers are supported
?int, width - the following conversion type characters are supported: 'c', 's', 'p', 'i', 'd', 'u', 'x', 'X', '%', the width specifier is supported, the precision specifier is not supported, only the '+', '-', '0' and ' ' flags are supported, no input size modifiers are supported
?long, width - the following conversion type characters are supported: 'c', 's', 'p', 'i', 'd', 'u', 'x', 'X', '%' the width specifier is supported, the precision specifier is not supported, only the '+', '-', '0' and ' ' flags are supported, only the 'l' input size modifier is supported
?long, width, precision - the following conversion type characters are supported: 'c', 's', 'p', 'i', 'd', 'u', 'x', 'X', '%', the width and precision specifiers are supported, only the '+', '-', '0' and ' ' flags are supported, only the 'l' input size modifier is supported
?float, width, precision - the following conversion type characters are supported: 'c', 's', 'p', 'i', 'd', 'u', 'e', 'E', 'f', 'x', 'X', '%', the width and precision specifiers are supported, only the '+', '-', '0' and ' ' flags are supported, only the 'l' input size modifier is supported.
The more features are selected, the larger is the code size generated for the printf and sprintf functions.
Float 가능하게 하는 방법을 결론만 말하자면,
옵션 변경(그림에서 (s)printf 를 변경)하면 된다.
함수 설명
void sprintf(char *str, char flash *fmtstr [ , arg1, arg2, ...])
this function is identical to printf except that the formatted text is placed in the null terminated character string str.
In order to reduce program code size, there is the Project|Configure|C Compiler|Code Generation|(s)printf features option.
It allows linking different versions of the printf and sprintf functions, with only the features that are really required by the program.
The following (s)printf features are available:
?int - the following conversion type characters are supported: 'c', 's', 'p', 'i', 'd', 'u', 'x', 'X', '%', no width or precision specifiers are supported, only the '+' and ' ' flags are supported, no input size modifiers are supported
?int, width - the following conversion type characters are supported: 'c', 's', 'p', 'i', 'd', 'u', 'x', 'X', '%', the width specifier is supported, the precision specifier is not supported, only the '+', '-', '0' and ' ' flags are supported, no input size modifiers are supported
?long, width - the following conversion type characters are supported: 'c', 's', 'p', 'i', 'd', 'u', 'x', 'X', '%' the width specifier is supported, the precision specifier is not supported, only the '+', '-', '0' and ' ' flags are supported, only the 'l' input size modifier is supported
?long, width, precision - the following conversion type characters are supported: 'c', 's', 'p', 'i', 'd', 'u', 'x', 'X', '%', the width and precision specifiers are supported, only the '+', '-', '0' and ' ' flags are supported, only the 'l' input size modifier is supported
?float, width, precision - the following conversion type characters are supported: 'c', 's', 'p', 'i', 'd', 'u', 'e', 'E', 'f', 'x', 'X', '%', the width and precision specifiers are supported, only the '+', '-', '0' and ' ' flags are supported, only the 'l' input size modifier is supported.
The more features are selected, the larger is the code size generated for the printf and sprintf functions.
Float 가능하게 하는 방법을 결론만 말하자면,
옵션 변경(그림에서 (s)printf 를 변경)하면 된다.
관련 문서가 검색되었습니다.
- [2011/03/24] 소수점(float,double) 있는 십진수를 이진수로 변환 (24264)
- [2011/03/23] C++, scanf 에서 float ,double사용하기 (30681) *2
- [2011/01/23] 카운트 다운을 FND에 출력 (14336)
- [2009/03/25] printf,sprintf에서 float,double 사용하기 (30184) *1