• 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: warning in main.m
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: warning in main.m


  • Subject: Re: warning in main.m
  • From: Dick Rucker <email@hidden>
  • Date: Fri, 02 Jan 2004 08:49:02 -0500

on 1/1/04 9:17 PM, matt neuburg at email@hidden wrote:

> Actually, it's worse than I thought. None of my older projects ("older" means
> created before the 1.1 upgrade was applied) has this problem! That's because
> *their* main.m declares main like this:
>
>  int main(int argc, const char *argv[])
>
> But *now* whenever I create a project, its main.m declares main like this:
>
>  int main(int argc, char *argv[])
>
> So, the problem is not that gcc changed. It's that main.m changed. And it
> changed from being right to being wrong

I'm a newbie to Objective C, and to C for that matter, so this may be a dumb
question, but what is being declared here?  Is it

(1) a variable array whose name is "argv[]" and whose type is
    "const char *", as in "constant character pointer"?

  or is it

(2) a variable array whose de-referenced name is "*argv[]" and whose type is
"const char"?

If it is the first, which I think it is, then shouldn't the template for
main's declaration put a space between the asterisk and the variable name,
like this?

      int main(int argc, const char * argv[])


Dick
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: warning in main.m
      • From: Kevin Grant <email@hidden>
  • Prev by Date: Re: cvs/ssh
  • Next by Date: SOLVED: Build process stuck in XCode
  • Previous by thread: Re: warning in main.m
  • Next by thread: Re: warning in main.m
  • Index(es):
    • Date
    • Thread