Learning Arrays. Questions...

Since I'm learning Arrays and I haven't learned them when I was studying C++ I excpect to have many questions, so I will gather all of them here instead of creating each time topics for specifical things and messing the forum.

Now, the basic fact about the coonection between arrays and pointers.

An array's name its an adress wright? - cause if you ouput its name it gives you an adress

Now my book into an example does the following
1
2
3
char v[4];
char* pointer = v;
...


OUTPUT
1
2
v is  37814124
pointer is 37814124


I mean isnt that somehow idiot? Put the pointer to an adress!

So when you output the pointer its like asking the adress of an adress!

Shouldnt that provoke an error?

------------------------------------------
My blog [http://georgesblogprogramming.blogspot.com/]. The learning process of C

Um... No... What are you talking about?
The address of the address would be &pointer or &v.
when you set the pointer to v, which is an adress, you re settin gthe pointer to an adress acutally and not to the adress of a value arent you?

So its like seting a pointer to a pointer.

Means that when you re going to output it, the pointer should seek for the adress of the adress that its pointing to (since it does not point to a value).

So shouldnt that be a fatal error?
Topic archived. No new replies allowed.