D
desktop
In accelerated C++ on page 146 there is this example:
template <class In, class Out>
Out copy(In begin, In end, Out dest)
{
While (begin != end)
*dest++ = *begin++;
return dest;
}
They say that the function takes 3 iterators, but is that not just
another name for a pointer?
If we are dealing with a string begin would be a pointer to the first
char, end would be a pointer to the last char and dest would contain the
copy.
Or does iterator mean something more complicated?
template <class In, class Out>
Out copy(In begin, In end, Out dest)
{
While (begin != end)
*dest++ = *begin++;
return dest;
}
They say that the function takes 3 iterators, but is that not just
another name for a pointer?
If we are dealing with a string begin would be a pointer to the first
char, end would be a pointer to the last char and dest would contain the
copy.
Or does iterator mean something more complicated?