본문 바로가기
dev/C

[C] 16진수를 문자열로 출력하기

by seohan1010 2024. 5. 29.

https://pythontutor.com/render.html#mode=display

 

Python Tutor code visualizer: Visualize code in Python, JavaScript, C, C++, and Java

Please wait ... your code is running (up to 10 seconds) Write code in Python 3.11 [newest version, latest features not tested yet] Python 3.6 [reliable stable version, select 3.11 for newest] Java C (C17 + GNU extensions) C++ (C++20 + GNU extensions) JavaS

pythontutor.com

 

 

 

 

 

#include <stdio.h>
#include <stdlib.h>

int main()
{


    char str1[10];
    int num1 = 200;

    sprintf(str1, "0x%x",num1);
    printf("%s\n",str1);


    return 0;
}

'dev > C' 카테고리의 다른 글

[C] 구조체  (0) 2024.05.29
[C] other - 1  (0) 2024.05.29
[C] function - atoi  (0) 2024.05.29
[C] function - strrchr()  (0) 2024.05.29
[C] function - strtok()  (0) 2024.05.29