Follow us on Twitter!
Never in the field of human conflict was so much owed by so many to so few. - Winston Churchill
Thursday, April 24, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 23
Guests Online: 23
Members Online: 0

Registered Members: 82889
Newest Member: Geriztul
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

C++ understanding the main()


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 15-07-06 19:36
I am into my book quite aways. And i have come across the "Understaning the main." in my complier the main is like so..
Code

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




K this is what i understand so far.
int argc - represents the # if the command line parameters.

ex. nmap -i ***.***.***.***

the nmap is the proram name and the -i is a parameter and also the ip ??? am i right so far ???

the second part i dont get at all the "char *argv[]" this part i do not understand in the book i tells me that is is and arry and thats it i dont know what is does plz explain ty for your time.

~zer0pian~


Author

RE: C++ understanding the main()


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 15-07-06 19:46
argc is the counter to how many arguments and argv[] is the array containing the arguments

and yes the ip is an argument as well




Author

RE: C++ understanding the main()


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 15-07-06 20:04
what do u mean by containg???


Author

RE: C++ understanding the main()


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 15-07-06 20:18
You know what an array is?
It's like a wallet wich contains multiple things of the same type

Like argv[] is an array containing multiple char*'s



Author

RE: C++ understanding the main()


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 15-07-06 21:00
ty i get ty 4 your time

~zer0pain~