ChinaUnix.net
相关文章推荐:

内核中如何使用sprintf

有如下语句:sprintf(out,"puts "recived your pakcet!" "),意思是想要把out的值赋为puts "recived your pakcet"!,怎样实现啊?

by tang79us - C/C++ - 2004-10-19 12:55:20 阅读(7649) 回复(2)

相关讨论

short jj=20000; sprintf(buffer,"%?",jj); 这个函数sprintf参数的?号该用啥时,在buffer只占两个字节

by - C/C++ - 2007-09-24 16:49:36 阅读(3258) 回复(6)

想把一个整数输出到一个字符串,在C语音里用sprintf就行了,但是在C++里不知道用什么。。。 也用sprintf会很麻烦 。。高人请指点一下。。:em14:

by rushrush - C/C++ - 2007-04-11 23:53:48 阅读(2478) 回复(8)

char buf[200]; char c='1'; sprintf(buf,"%c",c): 请教一下sprintf函数的使用

by sandy_23678 - C/C++ - 2003-06-06 14:40:06 阅读(3969) 回复(9)

sprintf("%.3g", $A) 请问g是什么意思? [ 本帖最后由 chinaseen 于 2007-5-23 11:56 编辑 ]

by chinaseen - Perl - 2007-05-23 15:04:15 阅读(1430) 回复(3)

在网上找到下面的这个例子,但啥都没看懂…… // 输出文  char szA[8];  WCHAR szW[8];  sprintf(szA, "%s", L"和平"); // 乱码,四个字节  sprintf(szA, "%s", "和平"); // 和平  sprintf(szA, "%S", L"和平"); // 零字节  sprintf(szA, "%S", "和平"); // 零字节  swprintf(szW, L"%s", L"和平"); // 和平,四个字节  swprintf(szW, L"%s", "和平"); // ...

by GodPig - C/C++ - 2009-11-10 14:12:52 阅读(18914) 回复(3)

求助:sprintf()里的%u如何实现? [code] #include #include #include #include "pgm.h" #define STRVAL_SIZE 10 int mini_sprintf(char * buf ,char * fmt, ... ) { va_list ap; char strval[10]; char *p; int nval; char *pval; uint8_t i; uint8_t index=0; va_start(ap,fmt); for(p=fmt;*p;p++) { for(i=0;i

by ATmega32 - C/C++ - 2007-06-11 14:36:37 阅读(4439) 回复(3)

#include int main(void) { char *a="MONDAY"; char *b="Hello"; char *c="welcome to Shanghai"; int l=strlen(a); int t= sprintf(a+l,"%s%s",b,c); printf("This is %s example\n",a); printf("the number is %d\n",t); } 输出 This is MONDAYHellowelcome to Shanghai example o Shanghai 这是怎么回事啊,第一行输出没问题,第二行太怪了

by shmtu2005 - C/C++ - 2011-06-15 10:20:29 阅读(2462) 回复(4)

c连接access Format$是access的一个系统函数,currentDate是一个变量.下面编译有错误,请问如何修改? sprintf(sqlInsertAccess,"insert into IsPass_t(locateName,currentDate) values (\'%s\',\'%s\')",fileName,Format$(currentDate,"yyyy/mm/dd"));

by sgxg_1999 - C/C++ - 2011-03-18 17:58:13 阅读(5006) 回复(28)

PHPsprintf()函数的学习研究笔记 sprintf 将字串格式化。phpma.com 语法: string sprintf(string format, mixed [args]...); 传回值: 字串 函式种类: 资料处理phpma.com 内容说明 本函式用来将字串格式化。参数 format 是转换的格式,以百分比符号 % 开始到转换字符为止。而在转换的格式间依序包括了 1. 填空字元。0 的话表示空格填 0;空格是内定值,表示空格就放着。 2. 对齐方式。内定值为向右对齐,负号表向左对齐。php...

by whxy5 - php文档中心 - 2007-11-13 16:13:17 阅读(647) 回复(0)

想模拟sprintf制作一个格式化函数,参考Linux-2.6.14libvsprintf.c发现相关的格式化函数都不支持浮点型(格式串不支持.f),望哪位xdjm指引一下方向.

by huang_bu - C/C++ - 2005-11-10 11:08:28 阅读(2194) 回复(2)