GIDForums  

Go Back   GIDForums > Computer Programming Forums > C Programming Language
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 23-Oct-2004, 19:05
crystalattice's Avatar
crystalattice crystalattice is offline
Aspiring author
 
Join Date: Apr 2004
Location: Japan (again)
Posts: 1,671
crystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nice

main() arguments


While struggling through the latest homework problem, one of the bits of code I got had this in the main.cc file:
CPP / C++ / C Code:
int main(int argc, char * const argv[])
What exactly does this do? I haven't seen this before and it's not
covered in my book (yet). I did get a copy of "C++ for Dummies", and
this is shown in the section on pointers, but it doesn't explain it
very well. All it pretty much says is that argc is the arguments
given to the program and argv[] is the array of pointers to these
arguments. So what does that mean to me, and when would I use it?
__________________
Start Programming with Python-A beginner's guide to programming and the Python language.

Interested in pen & paper role playing games from the "golden age" of gaming? Visit Old School Role-Playing Games
  #2  
Old 23-Oct-2004, 20:42
nkhambal nkhambal is offline
Awaiting Email Confirmation
 
Join Date: Jul 2004
Location: CA USA
Posts: 315
nkhambal is a jewel in the roughnkhambal is a jewel in the rough
There is a tutorial in the forum about command line argument which explains it in good details.

Thanks,
  #3  
Old 24-Oct-2004, 00:05
crystalattice's Avatar
crystalattice crystalattice is offline
Aspiring author
 
Join Date: Apr 2004
Location: Japan (again)
Posts: 1,671
crystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nice
Ah, didn't recognize that it was the same thing when I scanned it. Thanks for update.
__________________
Start Programming with Python-A beginner's guide to programming and the Python language.

Interested in pen & paper role playing games from the "golden age" of gaming? Visit Old School Role-Playing Games
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Having problem in calling functions inthe main harsha C Programming Language 1 13-Oct-2004 00:05
Problems returning to main and closing the current box warny_maelstrom C Programming Language 4 28-Apr-2004 22:54
Another problem dealing with main() and driver function tommy69 C Programming Language 4 20-Mar-2004 20:46
regarding main method jerry C++ Forum 18 09-Mar-2004 19:48

Network Sites: GIDNetwork · GIDApp · GIDBlog · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 11:58.


vBulletin, Copyright © 2000 - 2014, Jelsoft Enterprises Ltd.