Arrays of characters which end in a null are strings. You can use the name of the array in almost the same way you can use a pointer.
Code:
char foo[] = "This is a string.";
char *bar = foo;
bar[0] = 'F';
foo[1] = 'i';
bar[2] = 's';
foo[3] = 'h';
You can do some pointer math on 'foo' and it would work also. Now, the one thing to keep in mind when using array names like you do pointers is that you cannot make them point to something else. Example:
Code:
char foo[] = "blah blah";
char bar[] = "flah flah";
char *ptr;
ptr = foo; /* valid */
ptr = bar; /* valid, you can reassign pointers */
bar[0] = foo[0]; /* valid */
bar = foo; /* not valid */
*(bar+2) = 'a';
bar += 2; /* not valid because this would chante where 'bar' poitns */
You can change the value of what is being pointed at, but you cannot change what you're pointing at. That is to say, you cannot just assign 'foo' a new string.
Arrays always point at the same block of memory. You cannot do anything to change this. You can change what the block holds, but unlike pointers, you cannot make them point elsewhere.
That is the only real difference as far as C is concerned. (Other than the string literal issue we covered earlier.)
Quzah.