How do you use a pointer to access an entire array or pass an entire array. I know if u assign a pointer to an array it only represents the first element.
How do you use a pointer to access an entire array or pass an entire array. I know if u assign a pointer to an array it only represents the first element.
Generally, you do not need to use a pointer to point to an entire array. With a pointer to the first element and the size of the array (or a designated end value like a null character), you can traverse over the whole array. I find that a pointer to an actual array comes in handy usually only when you have a multi-dimensional array.Originally Posted by l_starter_l
On the other hand, if you use the standard containers (or a custom container class, for that matter) you generally do not have to worry about the automatic conversion to pointer types that built-in arrays have.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)