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
相关问答:
写了个测试程序如下
struct hostent *hp;
char AlarmDevIP[20];
int x2;
hp = gethostbyname("www.google.com");
if (hp)
{
......
本人正在用Java做一个C/S架构的项目,
可是由于项目比较大,前期对架构的设计尤其重要,因为后期可能随时会加个功能或者去掉某些功能。
所以特地寻求如何设计C/S的架构使程序更加面向对象更加易于维 ......
在根目录/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了
float x=8266.206055;
float y=7226.922363;
float z;
z=x*y;
z=59739228.000000;
为什么得到的Z 小数点后面全为0了
呵呵,超出浮点能表示范围了。
麻烦有人知道 ......