• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: int question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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>)

  • Prev by Date: Re: Is This Right?
  • Next by Date: Re: Is This Right?
  • Previous by thread: Re: int question
  • Next by thread: Re: int question
  • Index(es):
    • Date
    • Thread