易截截图软件、单文件、免安装、纯绿色、仅160KB

C main 函数有多少种代参数的形式? - C/C++ / C语言

如题, 一次笔试时被问到的。 我记得除了 void , argc argv 外还有一种带有三个参数的形式 具体在哪看过忘了...
高手出来说说都有什么形式的?
int main( int argc, char *argv[ ], char *envp[ ] );

前两个参数标准规定的,第三个是编译器扩展的

恩。 好像有个什么 char* env,不记得了。

int main( int argc, char *argv[ ], char *envp[ ] );

我也只知道2种 ,第三种是特定编译器才有的?

有一次见到了这种int main( int argc, char *argv[ ], char *envp[ ] );

HTML code:

ANSI C89:

2.1.2.2 Hosted environment

A hosted environment need not be provided, but shall conform to the
following specifications if present.

"Program startup"

The function called at program startup is named main . The
implementation declares no prototype for this function. It can be
defined with no parameters:

int main(void) { /*...*/ }

or with two parameters (referred to here as argc and argv , though any
names may be used, as they are local to the function in which they are
declared):

int main(int argc, char *argv[]) { /*...*/ }


If they are defined, the parameters to the main function shall obey
the following constraints:



就两种。

向一楼学习了

LZ,传统的C语言,main函数是只有两种参数形式的:
一、main() // 空的参数表
二、main(int argc , char *a


相关问答:

linux环境下gethostbyname函数问题 - C/C++ / C语言

写了个测试程序如下
   
  struct hostent *hp; 
char AlarmDevIP[20];  
  int x2;

hp = gethostbyname("www.google.com");
if (hp)
{ ......

C/S项目架构设计----求助 - Java / Java SE

本人正在用Java做一个C/S架构的项目, 
可是由于项目比较大,前期对架构的设计尤其重要,因为后期可能随时会加个功能或者去掉某些功能。 
所以特地寻求如何设计C/S的架构使程序更加面向对象更加易于维 ......

c静态编译另一个文件夹的库函数 - C/C++ / C语言

在根目录/lib中存放一个log.c,log.h,并用下面的语句:
gcc -c log.c
ar crv liblog.a log.o
编译出一个liblog.a静态库,然后在文件夹:/testfile中创建一个test.c和testc.c,test.c中引用了testc.c中定义的方法 ......

c 语言里浮点相乘 为什么小数全为0了 - C/C++ / C语言

如题:c 语言里浮点相乘 为什么小数全为0了
float x=8266.206055;
float y=7226.922363;
float z;
z=x*y;
z=59739228.000000;
为什么得到的Z 小数点后面全为0了
呵呵,超出浮点能表示范围了。

麻烦有人知道 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号