char argv & char** argv

closed account (1RX1wA7f)
Can I use only char argv instead of char** argv?
If yes, then why so?
What's the reason?
& What's the difference it's going to make?

Is it something related that it will accept only 1 command line argument value?
You can't
The standard main only accepts int and char**
i thought you could use int and *char[] as well
char* argv[] and char** argv mean essentially the same thing.

Edit: fix typo
Last edited on
sorry i dont understand double indirection that well. i can understand basic pointers and references but get confused when they start piling up. my textbook doesnt discuss it much.
If you understand the concept, then it really isn't that difficult.

A pointer just points to something else. If you have ** pointers, that just means they point to other pointers:

1
2
3
4
5
6
7
8
int* p;  // p points to an int
//  'p' is an int*
//  '*p' is an int

int** pp;  // pp points to an int*  (points to a pointer)
//  'pp' is an int**
//  '*pp' is an int*
//  '**pp' is an int 
Last edited on
closed account (1RX1wA7f)
Thank You to all!!!
Appreciated !!!
Topic archived. No new replies allowed.