</code>
int main(int argc, char * argv[])
</code>
Can someone tell me why there is the need of asterick for char *argv[]. Does this make argv[] a pointer?
</code>
int main(int argc, char * argv[])
</code>
Can someone tell me why there is the need of asterick for char *argv[]. Does this make argv[] a pointer?
argv is an array of char pointers, that's why there is an asterisk. Frankly speaking I myself doesn't know much about command line arguments, so other's reply will be more helpful.
HOPE YOU UNDERSTAND.......
By associating with wise people you will become wise yourself
It's fine to celebrate success but it is more important to heed the lessons of failure
We've got to put a lot of money into changing behavior
PC specifications- 512MB RAM, Windows XP sp3, 2.79 GHz pentium D.
IDE- Microsoft Visual Studio 2008 Express Edition
argv[] is an array of pointers to string constants.
incorrect !
How informative it is... We can only try to guess what is so incorrect about it.
The only good is knowledge and the only evil is ignorance.
~Socrates
hahah...
I like GLSam's answer "How informative it is!", comment of a logical thinker.
argv[] ??? - NO
*argv[] <--- YES, this is what I meant
Just kidding ! NVM!
Basically, it can be written as **argv or *argv[] as argv[] is equivalent to *argv.
If *argv, it means that it takes a string.
If **argv, it means that it takes many strings. For example you create a programme called "scan". What you do here is to firstly type in the programme's name (scan) and followed by arguments/parameters when you are using the programme.
eg. scan -sP -PN 127.0.0.1
So, scan is the first string, -sP is the second string and so on. if you put *argv or argv[] only, it will only read one string (most likely scan).
int argc will tel you the position of the parameters. argc = 0 would be scan, argc = 1 would be -sP.
If you do not understand, please ask further.