카테고리 없음
[C언어] int를 char으로 (sprint 함수 이용하기)
개발새발주발
2023. 8. 16. 21:50
728x90
#include <stdio.h>
int main() {
int intValue = 123;
char strValue[20]; // 충분한 크기의 문자열 버퍼를 할당
sprintf(strValue, "%d", intValue);
printf("Integer to string: %s\n", strValue);
return 0;
}
정수형을 문자형으로 바꾸는 sprintf()함수 기억하기 ~