View Single Post
Old Oct 15th, 2005, 7:38 AM   #7
aznluvsmc
Hobbyist Programmer
 
Join Date: Aug 2005
Posts: 137
Rep Power: 4 aznluvsmc is on a distinguished road
Quote:
Originally Posted by Navid
char array[21];

Just to point out that if you declare an array like above, the array has 21 elements, not 20. From 0-20, including the 0 are all elements. Sorry if Grumpy already mentioned that.
You're right, it has 21 elements but only 20 can be used to store the string characters in this example which was what I was referring to.

Thanks for your time Grumpy. In your last example, strings[0] stores a pointer to "Hello" first. But I guess it's also a constant string (still not sure what the rules governing this are) which means strings[0] is not modifiable after that point?
aznluvsmc is offline   Reply With Quote