Java main functions are generally defined as follows: public static void main (String [] args)
What does each word mean? One by one: public-indicates that the method main () can be accessed by any program, including the Java technical interpreter.
In C/C ++, a piece of code is executed before the main entry function is executed.
The initialization of global variables and static variables is executed before the main function. The example is as follows:
# Include
# Include
Class
Int main (INT argc, char * argv [], char * envp [])The main () function generally uses Int or void. I prefer to use the int type to define main. Because at the end of the operation, a value can be returned to the operating system to indicate
/* 7.16 implement the strlen () function for testing the string length ()*/# Include "stdio. H"Int strlen (char * P );Void main (){Char S1 [20] = "s1s2s3s4 ";Char * P = S1;Printf ("S1 length: % d \ n", strlen (S1 ));Printf ("S1 length: % d \ n",
To do a company project, to achieve a function is that the machine in a function (this work for a long time), want to cancel the work, re-select. Thought for a long while did not want to come out, the result colleague reminds a sentence, can add an
public static void Main (string[] args) {Shape shape;Scanner input = new Scanner (system.in);System.out.println ("Select the graphic (1, Circle 2, Rectangle 3, triangle)");int a = Input.nextint ();if (a = = 1) {System.out.println ("Please enter the
Two functions, two parameters of the main function
Compile two functions:
① Calculate the secondary and secondary values of N integers.
② Calculate the maximum common divisor and least common multiple of two integers.
# Include
Using namespace
Jar package using Eclipse packaging stepsRight-click on the item to be packaged-"SELECT Export"There are two ways to pack up here.1. If no other third-party package is used in the project, then the first one in the direct selection (JAR file)2. If
intMainintargcChar*argv[]) {@autoreleasepool {//four parameters mainly explain the following two parameters /*The third parameter: UIApplication or the class name of its subclass, if nil is the default is uiapplication fourth parameter:
Public class HelloWorld { Public static void main ( String[] Args { system.out. Println ( "hello World ) } } /span> Note: String args[] and string[] args can be executed, but it is
On the project, right-click Run as->run configurations...->arguments-> in the program Arguments: text box to enter the parameters you want to pass in, if there are several parameters in the space between the parameters. Then click the Run button.For
in the C language, Main () there are three forms of the function. 1 , no parameters#include int main (void) { printf ("Hello world!\n"); return 0;}2 , there are two parameters The first parameter is the integral type ARGC argv ,
In the Java language, the main () method is the entry for the entire program, which is the main () method that is loaded first at run time, but this does not mean that the main () method is the first module to be executed when the program is run.In
The main function and layout method of PS interface
1, open the desktop PS software. PS interface A lot of places can be moved and change their own more try to use their own habits to set, I here to explain the general setting of knowledge.
main function and use of Nginx
Author: Linux Commune
Original: http://www.linuxidc.com/Linux/2017-04/142962.htm
(Click to read the text at the end of the article to go)
These are the things that Nginx can handle without relying on third-party
Recent research on QEMU has similar code when initializing:
#define MODULE_INIT (function, type) \
static void __attribute__ ((constructor)) Do_qemu_init_ # # function (void ) { \
register_module_init
A main function with no formal parameters is generally written as:int main () or int main (void)Indicates that the Mian function has no arguments, and that no arguments are required to invoke the Mian function.
And the form of the main function's
Do you hear the word trojan, virus and so on will shudder?
Do you have a shadow on the reload computer?
Do you have déjà vu in the following scenario?
Finally find the latest movie play page, full screen ads dazzling, mouse operation step by step
#include #define PCHAR char* int main (int argc, char *argv[],char * Env) {int a=0; printf ("%d/n", a); PRI NTF ("%d/n", argc); printf ("%s/n", *ARGV); printf ("%s/n", * Env); return 0; }
In C-free, the results shown in the following figure, in
The main function provides a reference prototype such as:
int _tmain(int argc, _TCHAR* argv[]) { for(int i=0;i _tprintf(_T("%s\n"),argv[i]); return 0; } 或者如: int main(int argc, char **argv) { }
Linux for:
#include "/usr/include/stdio.h" int
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.