int main (int argc, const char * argv [])
{
for (int i = 0; i <5; i + +) {
printf ("China \ n");
}
return 0;
}
Finally, return 0; what role is it?
What two arguments main function is it?
Reply:
The return value is of type int main function, the function returns the value can not understand?
argc is the number of parameters, argv [] parameter representing them
So to execute the application:
. / Hello Parameter 1 Parameter 2
Reply:
Int return value can be understood, it returns 0 mean anything, what is 0 for non-return, return to positive and negative numbers What is the difference? Thanks to seniors
Reply:
Return value:
The usual practice is to return 0 for program execution is completed correctly, no error occurred. Returns a nonzero value indicates some error occurs, the specific value is defined by themselves, no fixed procedural requirements. And operation of the system does not return a different value because of changes because main () return value after the program has been successfully completed.
I guess, the return value will be acquired in the other external procedure call.
Parameters:
As a floor said, calling
. / Hello Parameter 1 Parameter 2
The value of the first main function argc is 2, which means that the number of parameters when calling hello
argv parameter value is represented by an array of incoming
Reply:
The return value is a numerical method returns nothing.
Function parameters that when you perform this method, you need to pass this parameter, like cinema tickets the same.
Parameters main method in the implementation, you can specify on the command line. 3 myself to say good!
Reply:
# 3 floor said it right
Reply:
Reply:
If you still can not understand the words, you can understand there is no effect, a fixed written. Later, you will slowly understand
Reply:
Reply:
You just write void main () {printf ("Hello World!");} Is correct. . . . main function is the starting point of a C function just like to write standardized. . .
Reply:
If you use another program to call your program, then you need to return the value of the program, is this a 0
Reply:
return 0; indicates a normal return
two parameters represent the main function of the address number of parameters, and parameters
Reply:
Everyone says are correct.
Reply:
Reply:
Use the command-line compiler.
Reply:
I think C lz still look better. The beginning of c is so written, and seemingly have nothing to iphone development
Reply:
argv parameters passed to start the application sandbox, sandbox contains the application needs to run library, application documentation, tmp applications, and the application itself.
Reply:
This is the problem c + + main function, regardless of the ios platform.
Proposal to buy the c + + primir look
Reply:
Generally return a value because we need this return value elsewhere;
Return 0 only because the habit of proper implementation of End main function returns 0;
Reply:
Take a look at C and then look at object-c that will understand some ......
Address
number of parameters, and parameters
return 0 return 0 for successful completion of the program
No comments:
Post a Comment