运行test函数有什么结果?
void setmemory(char **p, int num)
{ *p=(char *) malloc(num);}
void test(void)
{ char *str=NULL;
setmemory(&str,100);
strcpy(str,"hello");
printf(str);
}
运行test函数有什么结果?( )
//我觉得程序是正常运行的,另外问下malloc,free必需得在同一个函数里用吗??
谢谢
{ *p=(char *) malloc(num);}
void test(void)
{ char *str=NULL;
setmemory(&str,100);
strcpy(str,"hello");
printf(str);
}
运行test函数有什么结果?( )
//我觉得程序是正常运行的,另外问下malloc,free必需得在同一个函数里用吗??
谢谢
...全文
相关推荐
testit:Midje喜欢Clojure.test的断言
testit:Midje喜欢Clojure.test的断言
PHP执行linux命令常用函数汇总
一般情况下,很少会用php去执行linux命令,不过特殊情况下,你也许会用到这些函数。以前我知道有二个函数可以执行linux命令,一个是exec,一个是shell_exec。其实有很多的,结合手册内容,介绍以下6个函数。 1,exec函数 <?php $test = "ls /tmp/test"; //ls是linux下的查目录,文件的命令 exec($test,$array); //执行命令 print_r($array); ?> 返回结果如下: [root@krlcgcms01 shell]# php ./exec.php Array ( [0] => 1001.log [1] =>
Linux Shell函数返回值
主要介绍了Linux Shell函数返回值,需要的朋友可以参考下
基于C实现的判断一个数是否为素数的函数及测试函数
判断一个数是否为素数 基于C实现的判断一个数是否为素数的函数
perl-test-regexp-pattern
perl-test-regexp-pattern


