Command line arguments

Member
Posts: 61
Joined: 2007.01
Post: #1
Evening,

I'm trying to pass some arguments to a program I'm running in XCode - it's actually a GLUT application. I'd like to pass the number of objects I want displayed to the application.

I tried to add the arguments by editing the settings for my project, but when I tested it out by passing 100 as an argument, the value contained in argc turned to be 3.

Thanks,

Anthony
Quote this message in a reply
Moderator
Posts: 608
Joined: 2002.04
Post: #2
argc is the number of arguments passed. argv is the argument values.
Quote this message in a reply
Member
Posts: 61
Joined: 2007.01
Post: #3
Thanks a million for your reply Josh, I'd eventually come to the same conclusion myself but I went to bed before posting it.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
You may find the atoi function helpful here Wink
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Read a text file line by line? jdunehew 6 11,688 Dec 29, 2011 11:54 AM
Last Post: Blacktiger
  Applets from the Command Line merrill541 0 2,206 Nov 23, 2008 12:44 PM
Last Post: merrill541
  "Command /.../jam failed with exit code 1"- huh? Joseph Duchesne 2 5,852 Mar 29, 2006 09:32 AM
Last Post: socksy
  Configure command Blorx2 1 2,564 Mar 25, 2005 02:07 PM
Last Post: NCarter