Re: int question
Re: int question
- Subject: Re: int question
- From: email@hidden
- Date: Tue, 5 Jun 2001 10:46:35 -0700
>
Would someone be kind enough to explain what this line of code does:
>
>
int main (int argc, const char * argv[])
>
>
I know it's declaring integer variables, but I can't find any reference
>
to "argc" or "const char * argv[]", and I can find nothing to explain
>
the use of the ().
This is all basic C stuff - which you really need to know before you try to
learn before trying to develop on the Mac. This is the declaration of the
starting point for all C C++ and Obj-C applications - it is a function
called main which returns an int (defined in the standard, not often used
but can be used to indicate success of the program). argc and argv are
command line parameters that may have been passed to the program. These
will generally not be used for GUI programs (except in some very rare
circumstances), but for command line tools are the primary way of passing
information into your program.
I would recommend getting a book on C and starting there, then come back
when you're comfortable with it...