当前位置: 技术问答>linux和unix
Linux C 内核代码中 整型转化为字符串 的 问题、。
来源: 互联网 发布时间:2017-02-18
本文导语: #include #include "inttostr.h" /* Convert I to a printable string in BUF, which must be at least INT_BUFSIZE_BOUND (INTTYPE) bytes long. Return the address of theprintable string, which need not start at BUF. buf的长度必须大于等...
#include
#include "inttostr.h"
/* Convert I to a printable string in BUF, which must be at least
INT_BUFSIZE_BOUND (INTTYPE) bytes long.
Return the address of theprintable string, which need not start at BUF.
buf的长度必须大于等于INT_BUFSIZE_BOUND (INTTYPE) bytes long*/
char *
inttostr (inttype i, char *buf)
{
char *p = buf + INT_STRLEN_BOUND (inttype);//p指向内存的尾端;
*p = 0;//末端置0;
if (i