autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: String functions with end pointers?


From: Bob Proulx
Subject: Re: String functions with end pointers?
Date: Fri, 5 May 2006 23:10:48 -0600
User-agent: Mutt/1.5.9i

Paul D. Smith wrote:
> I'd much prefer to keep a pointer to the end of the buffer: this won't
> change so it doesn't need to be managed.  For example, something like:
> 
>     char *strpchr(const char *str, const char *endp, int c);
> 
> or whatever.
> 
> Of course, there aren't any standard str*() or mem*() functions that I'm
> aware of that use an end pointer instead of a length.

I read this and could not help but notice the similarity to the C++
STL iterators.  However the STL always uses a pointer to one beyond
the end of the data while the above (if I read that correctly) uses a
pointer within the bounds.  I am not saying one is better than the
other.  Just noting the similarity and the difference.

Bob




reply via email to

[Prev in Thread] Current Thread [Next in Thread]