主功能 [英] main function

查看:105
本文介绍了主功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我的同事们听过很多讨论,主要是用户

定义的功能。


参数赞成: -


1)如果它是在函数中构建的,它必须在某个头文件中定义

但它是不是。


2)每次我们定义主要功能应如何工作


参数反对: -


1)无法从命令行调用用户定义的函数


有人说它是一个特殊的用户定义函数,这就是

执行C程序的起点。


现在问题是


1)究竟答案是什么? ???? b $ b 2)在自由站立的实施中主要是起点

的执行.. ????

Hi all,

I have heard many discussions among my colleagues that main is a user
defined function or not.

arguments in favour:-

1) if it is built in function it must be defined in some header file
but it is n''t.

2) every time we are defining how the main function should work

arguments against:-

1)user defined functions cannot be called from command line

some say that it is a special user defined function ,which is the
starting point of execution of a C program.

now questions are

1) What exactly is the correct answer..????
2) in free standing implementations is main the starting point
of execution..????

推荐答案

aa*****@gmail.com 写道:

大家好,


我的同事们听过很多讨论,主要是用户

定义的功能。


参数支持: -


1)如果它是在函数中构建的,它必须在某个头文件中定义

但它是n'' t。
Hi all,

I have heard many discussions among my colleagues that main is a user
defined function or not.

arguments in favour:-

1) if it is built in function it must be defined in some header file
but it is n''t.



在库中定义的标头中声明。

Declared in a header, defined in a library.


2)每次我们都是定义主函数应该如何工作


参数反对: -


1)无法从命令行调用用户定义的函数
2) every time we are defining how the main function should work

arguments against:-

1)user defined functions cannot be called from command line



也不能包括main。

Nor can any other, including main.


有人说它是一个特殊的用户定义函数,它是

执行C程序的起点。


现在问题是


1)究竟是什么正确答案..????
some say that it is a special user defined function ,which is the
starting point of execution of a C program.

now questions are

1) What exactly is the correct answer..????



标准指定main作为在

程序启动时调用的函数的名称。任何标题中都没有原型,因为

函数可以有两个中的一个。

The standard specifies main as the name of the function called at
program startup. There isn''t a prototype in any headers because the
function can have one of two.


2)免费常设实施是主要的起点

执行.. ????
2) in free standing implementations is main the starting point
of execution..????



在独立环境中,在

程序启动时调用的函数的名称是实现定义的。

-

Ian Collins。

In a freestanding environment, the he name of the function called at
program startup is implementation defined.

--
Ian Collins.


aa ***** @ gmail.com 写道:

大家好,


我我的同事们已经听过很多讨论,主要是用户

定义的功能与否。
Hi all,

I have heard many discussions among my colleagues that main is a user
defined function or not.



语言规范说什么?


我建议您获得一份标准(或标准草案)是免费的b $ b - 请参阅常见问题解答以获取一些指示。


您似乎要问的很多问题都可以简单回答
通过阅读标准而不是交换意见来获得
。在这种情况下,

第5.1.2节似乎相关(我正在使用C99草案PDF)。

What does the language specification say?

I suggest you get a copy of the standard (or the draft standard which is
available free) - see the FAQ for some pointers.

A lot of the questions you seem to be asking would be answered simply
by reading the standard rather than swapping opinions. In this case,
section 5.1.2 seems relevant (I''m using the C99 draft PDF).


参数支持: -


1)如果它是内置的函数,它必须在一些头文件中定义

但它不是。
arguments in favour:-

1) if it is built in function it must be defined in some header file
but it is n''t.



据我所知,目前还没有任何关于内置功能的定义

C语言规范。有一些功能需要

实现提供和主要实现。不是其中之一。

There isn''t, as far as I''m aware, any definition of "built in function"
in the C language specification. There are functions which an
implementation is required to provide and "main" isn''t one of them.


2)每次我们定义主函数应该如何工作
2) every time we are defining how the main function should work



足够真实。虽然标准定义了它的参数必须是什么。

True enough. Though the standard defines what its arguments must be.


参数反对: -
arguments against:-


1)无法从命令行调用用户定义的函数


有人说它是一个特殊的用户定义函数,它是

的执行起点一个C程序。


现在问题是


1)究竟什么是正确答案.. ????
1)user defined functions cannot be called from command line

some say that it is a special user defined function ,which is the
starting point of execution of a C program.

now questions are

1) What exactly is the correct answer..????



标准说什么?

What does the standard say?


2)在自由站立实施中是主要的起点

执行.. ????
2) in free standing implementations is main the starting point
of execution..????



这取决于实施。该标准仅强制要求

托管实现。

That depends on the implementation. The standard only mandates main for
hosted implementations.


aa ***** @ gmail.com 写道:

大家好,


我有我的同事们听到很多讨论主要是用户

定义的功能与否。
Hi all,

I have heard many discussions among my colleagues that main is a user
defined function or not.



为什么?你是否厌倦了对针上的跳舞天使进行计数?

Why? Did you get tired of counting the dancing angels on the needle?


这篇关于主功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆