Re: int question
Re: int question
- Subject: Re: int question
- From: Finlay Dobbie <email@hidden>
- Date: Tue, 5 Jun 2001 20:20:51 +0100
On Tuesday, June 5, 2001, at 05:36 pm, Brian Howard wrote:
Would someone be kind enough to explain this line of code:
int main (int argc, const char * argv[])
I can find no reference to "argc" or "const" or "argv", and I do not
understand the use of the () at all.
The best I can guess at is that the variable "main" is an integer that
could be either "argc" or the product of "const" times "argv[]".
Damn, I hate having to ask these dumb ass questions. Thanks again,
Apple.
This has nothing to do with Apple. This is the standard entry point for
*EVERY* UN*X application.
main is a function called when your application starts up. it's int
main, because main is the return type. in the () are the function
parameters. argc is the argument count, argv is an array of const char
that are the arguments.
* means pointer.
i really suggest you learn C before tackling cocoa - it will help.
-- Finlay
References: | |
| >int question (From: Brian Howard <email@hidden>) |