printf("%d\n",strlen("ATS\n012\1\\")); strlen是什么? \1是什么
by linux_paly - C/C++ - 2007-12-10 23:06:35 阅读(1369) 回复(6)
[color="#000000"]自定义的函数: [color="#990000"]函数执行: 实例: 取得IP所对应的DNS名称 (IP -> FQDN) [color="#000000"]$host= gethost($ip); echo "hostname: $host"; ?> 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/28922/showart_345382.html
if ((fd6=CreateFile("item6.txt",GENERIC_WRITE,0,NULL,TRUNCATE_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL))==
INVALID_HANDLE_VALUE)
{
printf("CreateFile run failed,errno:%u,file:item6.txt.\n",GetLastError());
free(pitem6);
free(pitem5);
free(pitem4);
return 1;
}
for (i=0;i
这是一个简单的毫无疑义的问题,当然也只有菜鸟的我才能问得出来.:oops: [code]printf("%d",getpid());[/code] getpid()的返回类型应该是pid_t. %d,响应的应该是 int so,如果 [code] struct mystruct a; printf("%d", a); [/code] 毫无疑问,这样问题倒是没有,不过结果...... 显然对a做了一个 int( ). 当然,在printf()的概念里面,是没有拷贝构造函数这一说法的,如果有呢.... 这里同样也是c++版.:em11: 请指点,thx
看到 [code] printf("the stack :\n%p\n%p\n%p\n%p\n%p\n%p\n"); [/code] 可以打印堆栈里面的东东,感到很奇怪; man 了一下,里面只是说,void *参数是以16进制打印出来 那位解释一下: 怎么printf()中没有变元,就可以让%p打印出stack里的东西呢? thx
a=40.256 printf ( "a: %4.2f%\n",$a); 报错说Invalid conversion in printf: "%\012" at test line 23. 这是怎么回事 我脚本上有-w 和use strict :roll: :roll: :oops: