在这段代码中:
main
缺少默认入口点。"""
用于什么- 它会导致错误。%u
which is for unsigned
type where as ul
is of unsigned long
type,请%lu
改用。s = "asb"
不是正确的方法 - 使用strcpy
或strcat
取决于您要实现的目标。这是一个功能版本:
#include<stdio.h>
#include<string.h>
int main()
{
char s[20];
unsigned long ul = 1234567890;
sprintf(s,"%lu",ul);
strcat(s,"asb"); //CAN USE STRCPY AS WELL
printf("%s\n",s);
return 0;
}
输出: 1234567890asb
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句