View Single Post
  #2 (permalink)  
Old 07-18-2008, 11:29 AM
MrPickle's Avatar
MrPickle MrPickle is offline
PT Admin
Join Date: Nov 2007
Location: England, Lincolnshire
Posts: 332
iTrader: (0)
MrPickle is a jewel in the roughMrPickle is a jewel in the roughMrPickle is a jewel in the rough
A pointer is used to point to a memory cell instead of creating a new variable at a new memory cell. This means that the pointer is always the value of whatever the memory cell's value is.

Now, each memory cell of our computer has it's own address, like your street or an estate for example. Now when you use & it gets the address of the variable instead of the value.

Try doing this for example:
Code:
foo = 5;
std::cout << &foo << std::endl;
std::cout << foo << std::endl;
You'll see that the first result is a series of numbers and letters, whereas the second result is 5.

Now for the array bit. When you pass an array to a function it doesn't take the value of the array, but points to the addresses of the memory cells that the array's data is stored in. So to answer your first question. char** name is pointing to a multidimensional array (double array as you called it), so it's a pointer.

Hope this helped I'm no Bench, but I tried my best

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
The Following User Says Thank You to MrPickle For This Useful Post:
lwinaung (07-19-2008)