cplusplus.com
C++ : Forum : Beginners : question about argv
 
cplusplus.com
Information
Documentation
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs


post question about argv

Chronophile (4)
Hello, I have a question about the char **argv array in then main function of a any C/C++ program.

I know that char* is a pointer to a string, but how does ** make it an array?

Could this syntax be used for other array types like "int *my_array" or is specific to char?



Also if I have a const vector<int>, do I need a special iterator like

const_vector<int>::iterator

or can I use a normal vector<int>::iterator ?



thanks.
Last edited on
helios (9408)
A char * is a pointer to an array of chars.
A char ** is a pointer to an array of pointers to arrays of chars.

Yes, the syntax can be used for anything else.
mahlerfive (119)
For the second question, you need to use a const_iterator.

So, vector<int>::const_iterator
Topic archived. No new replies allowed.