>Vir Campestris <vir.cam...@invalid.invalid> writes:
>>On 09/04/2015 14:06, Victor Bazarov wrote:
>>> On 4/9/2015 8:12 AM,
asetof...@gmail.com wrote:
>>>> I would like to know if
>>>> main(x){printf("%x",x);}
>>>> Is a valid C++ program
>>>> and what number it print...
>>>
>>> Not a valid C++ program.
>>>
>>Not valid - or just not compatible with any OS I ever came across?
>>
>>(Win and *n?x seem to require argc and argv...)
>>
>
> *n?x provides argc, argv, envp and auxv. Most programs
>only use argc, argv, and some use envp as well. There is
>nothing illegal or undefined about defining main to consume
>only the argc parameter; the remaining parameters passed by
>the exec call will be ignored and unavailable to the app
>(although getenv()/setenv()/putenv() will access the environment
>directly). auxv, which is passed from the kernel,
>is often consumed by the run-time-linker/loader and may or may
>not be provided to the application depending on the OS.
per the standard. Yes, with some of the common calling conventions