一个数为128.如何按00128 五位数 输入到字符数组里

一个数为128.。怎么按00128 五位数 输入到字符数组里?
一个数为128.。怎么按00128 五位数 输入到字符数组里?
不足5位的数都前面补0




------解决方案--------------------
C/C++ code

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

int main(void)
{
    int num=128;
    char buf[10];
    sprintf(buf, "%05d", num);    //%05
    puts(buf);
    return 0;
}