Three parameters (arguments) are passed to main by the CodeGear C++Builder startup routine: argc, argv, and env.
int main() int main(int argc) /* legal but very unlikely */ int main(int argc, char * argv[]) it ain(int argc, char * argv[], char * env[])]
The declaration int main(int argc) is legal, but it is very unlikely that you would use argc in your program without also using the elements of argv.
The argument env is also available through the global variable _environ..
For all platforms, argc and argv are also available via the global variables _argc and _argv.
The Unicode version of the main function is:
int wmain (int argc, wchar_t *argv[])
The argv (and optional envp) parameter(s) support(s) wide-characters.
The following _tmain function is a macro that expands to the appropriate version of the main function depending upon the type of application:
int _tmain (int argc, _TCHAR *argv[])
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
|
What do you think about this topic? Send feedback!
|