ChinaUnix.net
相关文章推荐:

sprintf函数 too few arguments for format

今天编译一很老的程序时出现: error: too few arguments to function 'exit' 查找原因原理是里面有几个函数是exit(); 后来把exit()改成exit(0);问题就解决了。 是不是现在编译器不认exit()了吗? 谢谢。

by letwave - C/C++ - 2008-09-09 09:46:27 阅读(10153) 回复(4)

相关讨论

代码如下, 编译工具为VS2008和code block std::vector a; std::vector iterator it=a.begin(); 目的是创建iterator遍历 a 中的元素。 或者,应该是其它写法? [ 本帖最后由 user2003 于 2010-1-25 16:31 编辑 ]

by user2003 - C/C++ - 2010-01-25 16:56:29 阅读(2457) 回复(3)

本帖最后由 tzyhpcom 于 2013-04-24 13:19 编辑 最近在研究netlink。内核是2.6.32-5。在内核模块中使用netlink_kernel_create函数时一直提示error: too few arguments to function netlink_kernel_create。我看到本机内核即2.6.32中头文件中的此函数定义是:[code]extern struct sock *netlink_kernel_create(struct net *net, int unit,unsigned int groups, ...

by tzyhpcom - 内核源码 - 2013-04-29 10:31:04 阅读(2603) 回复(5)

如果这样使用sprintf函数会不会有什么影响? #include int main(int argc, char *argv[]) { char *p = "hello"; char buf[100]; sprintf(buf, p); printf("%s\n", buf); return 0; } 这样编译时会出现警告 warning: format not a string literal and no format arguments 程序能正常运行,sprintf的第二个参数也是个字符串,只不过是格式化字符串,按说是没问题...

by h3216542010 - C/C++ - 2013-01-25 15:36:42 阅读(1321) 回复(7)

各位,有谁知道sprintf()的原码是怎么样的吗? 谢谢!

by liaoweijun - C/C++ - 2007-07-27 12:28:04 阅读(4777) 回复(3)

我想将sprintf函数中的格式居左,例如: sprintf("%20s=%20s","x","123"); 现在123是居右。 谢谢帮忙!

by 流言飞语 - Perl - 2005-01-08 11:44:47 阅读(2506) 回复(2)

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

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

#!/bin/bash a=`ps aux|grep httpd|awk '{print $2}'` if [ "$a" ne 0 ] then exit else /usr/local/apache2/bin/apachectl start echo "restart.`date`" >> aaa.txt fi 提示 :too many arguments 用了" "--还是提示这个 ?

by 版主杀手 - Shell - 2010-12-28 18:00:58 阅读(6947) 回复(18)

-----------------------------------------------------分割线 #!/bin/sh # Program: # Kill the three processes named with 'a','b' and 'c' in absolute path. # History: # 2010/12/21 YangBo Fourth Release PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH #Tell if the three processes exist if [ -n `ps -ef|grep $PWD/a|grep -v grep` ] && [ -n `ps -ef|grep $PWD/b|grep ...

argumentsmanyshelltoo

by RouterGhost - Shell - 2010-12-22 21:13:16 阅读(3135) 回复(6)

#!/bin/bash if [ -z $1 -o -z $2 -o -z $3 -o -z $4 -o -z $5 -o -z $6 -o -z $7 ] then echo 'hehe' else echo 'haha' fi ./test.sh: line 2: [: too many arguments haha

by ywxwillam - Shell - 2009-04-03 22:17:34 阅读(4697) 回复(10)

我在HP-UX和Solaris的操作系统上,写了一个这样的小程序,如下,当显示i=3408时,程序中断,并提示arguments too long. 但是我在Linux上是没有的,请问如何解决这个问题呢?是csh的版本吗? #!/bin/csh set i = 1 set a = () while ($i <= 4000) echo $i set a = ($a $i) @ i++ end

by 人在深圳混 - Shell - 2008-09-17 09:18:55 阅读(1282) 回复(0)