ChinaUnix.net
相关文章推荐:

return函数

如题 谢谢, #incude int main() { printf("hello world\n"); return 0; }

by 我是害虫 - C/C++ - 2011-06-06 21:04:40 阅读(1965) 回复(2)

相关讨论

sub cut2fmt { my(@positions) = @_; my $template = ''; my $lastpos = 1; foreach $place (@positions) { $template .= "A" . ($place - $lastpos) . " "; $lastpos = $place; } $template .= "A*"; } $fmt = cut2fmt(8, 14, 20, 26, 30); print "$fmt\n"; 在上边的函数中$template是不是在调用函数的时候存储的数值是@temolate={A7,A6,A6,A6,A4,A*}; 不和c语言中的一样只...

by bst - Perl - 2004-09-26 10:17:04 阅读(1314) 回复(1)

如题,gcc里面的很多__builtin_xxxx 函数在哪里可以查看啊。 去gcc官网下了分gcc手册。。里面有一些 ,但是不全啊。 请问有人知道吗 这些内嵌函数 到哪里可以查看 函数介绍 全面的

by tc1989tc - 内核源码 - 2014-12-05 09:19:46 阅读(1187) 回复(5)

没有返回值的main函数,怎么return?[code][root@localhost C]# cat a1.c #include void main(void){ int * ptr; int fort[2][2]={{12},{14,16}}; ptr = fort[0]; printf("1= %d , 2= %d \n",*ptr,*(ptr+2)); return; } [root@localhost C]# gcc a1.c a1.c: In function 'main': a1.c:5: warning: return type of 'main' is not 'int'[/code]return;不行吗?为什么还有warning?

by ccc77 - C/C++ - 2010-11-06 15:01:04 阅读(2010) 回复(2)

[color="#c60a00"]exit(0) 表示程序正常, [color="#c60a00"]exit([color="#c60a00"]1)/[color="#c60a00"]exit(-[color="#c60a00"]1)表示程序异常退出 exit() 结束当前进程/当前程序/,在整个程序中,只要调用 exit ,就结束 return() 是当前函数返回,当然如果是在主函数main, 自然也就结束当前进程了,如果不是,那就是退回上一层调用。在多个进程时.如果有时要检测上进程是否正常退出的.就要用到上个进程的返回值.. exit(1)表...

by songlin226 - Linux文档专区 - 2008-03-03 10:58:15 阅读(1130) 回复(0)

我在一个函数返回时return一个函数: static int func1(char *name); static int func2(); int func2() { char name[10]; memset(name, 0, sizeof(name)); sprintf(name, "%s", "harry"); ... return func1(name); } 我觉得局部变量name在进入func1前是不是已经被出栈释放了,如果我必须要给func1传参数的话,该怎么做?

by linux_ha - C/C++ - 2007-10-26 15:22:15 阅读(4066) 回复(6)

[color="#c60a00"]exit(0) 表示程序正常, [color="#c60a00"]exit([color="#c60a00"]1)/[color="#c60a00"]exit(-[color="#c60a00"]1)表示程序异常退出 exit() 结束当前进程/当前程序/,在整个程序中,只要调用 exit ,就结束 return() 是当前函数返回,当然如果是在主函数main, 自然也就结束当前进程了,如果不是,那就是退回上一层调用。在多个进程时.如果有时要检测上进程是否正常退出的.就要用到上个进程的返回值.. exit(1)表...

by xmuguo - Linux文档专区 - 2007-09-05 17:40:07 阅读(785) 回复(0)

构造函数中难道不能使用return? -------------------------------------------------------------------------------- 我不返回任何值,难道也不能使用? 例如: [code] if(i<0) return; [/code] 这样也不可以?为什么?

by fibbery - C/C++ - 2006-11-29 17:22:40 阅读(4303) 回复(6)

if exists(select * from sysobjects where name=\'itpub\' and type=\'u\') drop table itpub create table [itpub](--新建一个表 id int , munid int, item varchar(100)) --象表里面插如记录 insert [itpub] select 1,102,\'BAGS \' union all select 2,102,\'SWATCH \' union all select 3,105,\'TEA\' union all select 4,105,\'T_SHIRTS\' GO --创建...

by juan025 - SQL server - 2006-04-03 21:51:16 阅读(3086) 回复(2)

测试代码如下: int fun1() { while(1) { NULL; } return 1; } int fun() { char *str = "hello"; return fun1(); } int main(void) { int a = fun(); int b = fun1(); return 0; } ---------------------------------------------------------------------------------- 我想问下这个函数return到底是什么作用?在调用fun函数的时候,return 的fun1()是什么?是fun1()函数的返回值么?是不是只要执行到return的时...

by udsking - Linux环境编程 - 2009-05-07 15:15:40 阅读(1142) 回复(0)

我在子函数里用了return(x,y);语句,在主函数里用变量xx,yy来接收这两个返回值。但根据逗号运算法则,只能接收逗号右边的值,也就是y。请问我应该怎么做才能将两个返回值分别赋给xx,yy?谢谢!

by da vinci - C/C++ - 2004-12-20 14:36:35 阅读(12510) 回复(9)