ChinaUnix.net
相关文章推荐:

c语言函数传参

#!/bin/sh is_dir(){ for loop in `ls $1` do if [ -d $loop ] then echo d is_dir $loop elif [ -f $loop ] then echo f is_file $loop else echo "不知道什么类型" #为什么到这里的数就判断不出它的类型? fi done } is_file(){ ls -l $1 } for loop in `ls -l /root` do if [ -d $loop ] then is_dir $loop ...

by meloncao - Shell - 2007-03-09 17:42:52 阅读(1119) 回复(1)

相关讨论

本帖最后由 sundae333 于 2015-05-21 10:41 编辑 #define SIGGETIMER (SIGRTMAX) static void GlobalTimerHandler(int signo, siginfo_t* info, void* context) { CGeTimer *pTimer; if( signo != SIGGETIMER ) return; pTimer = (CGeTimer*)(info->si_ptr); pTimer->handler(); } 函数是信号处理函数(实时信号64) 注册代码(sigaction): sigemptyset(&sysact.sa_mask); sysact.sa_flags = SA_SIGINFO; sy...

by sundae333 - C/C++ - 2015-05-25 08:55:57 阅读(1935) 回复(6)

本帖最后由 chengengsen 于 2011-12-07 09:34 编辑 今天看了C primer plus 第222-223页关于函数的部分,有点不明白,说出来大家讨论一下:[code]int imax(); int main() { .......... imax(3.0,5.0); ........... } int imax() int n,int m; { ............ }[/code]1.作为递时,float类型会被转换为double类型,所以两个double类型的数值被压入栈,imax()从栈中读取两个int类型数值是,它会读出64位数据,读取...

函数

by chengengsen - C/C++ - 2011-12-07 19:08:57 阅读(2059) 回复(6)

本帖最后由 灰菲湮灭 于 2010-12-01 16:41 编辑 [code] type=1 function getNthVal { echo "$1" } if [ "$type" = "1" ];then for ((i=0; i<4; i++));do getNthVal $i done elif [ "$type" = "2" ];then echo "type" fi[/code]如上所示,我想在echo $打印出来0,1,2,3,但这样写打出来的是i,如何解决呢? 谢谢 已解决。。。。唉

by 灰菲湮灭 - Shell - 2010-12-02 10:56:58 阅读(5523) 回复(3)

收起帖子 [ 本帖最后由 kingink1983 于 2009-1-15 00:46 编辑 ]

by kingink1983 - C/C++ - 2009-01-13 21:17:32 阅读(1772) 回复(5)

[code]a(){ char *a[10][10] ; ... b(a); } b(char ***b){ ... } [/code] b(a) ; ----这样调用行吗?怎么会有warning: parsing arg 1 of 'b' from incompatible pointer type.

by 小飞爱使申华 - C/C++ - 2003-06-30 22:48:16 阅读(1016) 回复(5)

#!/usr/local/bin/php -q [lu@so uprbtcl]$ php test.php 1 2 3 Hello, 1 2! How are you today? ~~小试成功!! PHP作为Shell脚本时有一个内嵌的数组“$argv”,使用“$argv”数组可以很方便的读取Shell脚本运行时候的数 开心中~ 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/1184/showart_62754.html

by Digico - php文档中心 - 2005-12-21 15:23:30 阅读(1410) 回复(0)

C语言 mysql select 查询,怎样啊? 比如: char *sql="select passwd from user_info where user_id='account'"; account是个变量,查询出来总是 “-1行受到影响”!是数没进去吗?

by 张美英 - C/C++ - 2013-01-04 10:25:46 阅读(5919) 回复(14)

[code]bsd# perl -e '$b="cd";sub a { print "@_\n"; $_[1]="uu";} a("a",$b); print "$b\n"' a cd uu bsd# perl -e '$b="cd";sub a { print "@_\n"; $_[1]="uu";} a("a","$b"); print "$b\n"' a cd cd bsd# [/code]

by meihuaqi - Perl - 2011-02-18 10:26:53 阅读(3039) 回复(3)

本帖最后由 cao627 于 2015-01-03 10:40 编辑 [code] include void test1(int a,int b, int c) { int * p; p = &a; printf("%d\n", *p); p--; printf("%d\n", *p); p--; printf("%d\n", *p); } void test2(const char * s, ...) { int * p; p = (int *)&s; p++; printf("%d\n", *p); p++; printf("%d\n...

by cao627 - C/C++ - 2015-01-05 16:39:12 阅读(3267) 回复(17)

最近一直在学C语言:但是今天遇到了一个问题,想了很久也没想明白。问题描述如下: void receive_data(struct sockaddr_in *save) { struct sockaddr_in *client_ip; client_ip=(struct sockaddr_in *)malloc(sizeof(struct sockaddr_in)); client_ip->a=0; client_ip->b=1; client_ip->c=2; save=client_ip; } int main() { struct sockaddr_in *client_ip; client_ip=NULL; receive_data(client_ip); ...

by hui_se0 - 嵌入式开发 - 2011-06-28 09:19:35 阅读(2844) 回复(2)