Thread: char *
View Single Post
Old Feb 27th, 2006, 12:19 AM   #10
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 769
Rep Power: 3 Jimbo is on a distinguished road
A pointer points to a char in memory, but an array is a sequence of consecutive chars in mem. So you could have a pointer to the first one, and then iterate through memory (by incrementing the pointer) to get the rest of the array.

Basically, arrays are pointers that only point the the first item yet still index the whole array. (array[i] == *(array+i))

You'll see the similarities a lot more when you use dynamic memory allocation
Jimbo is offline   Reply With Quote