autoconf
[Top][All Lists]
Advanced

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

Re: String functions with end pointers?


From: Paul D. Smith
Subject: Re: String functions with end pointers?
Date: 25 Apr 2006 08:39:38 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

%% Russell Shaw <address@hidden> writes:

  rs> Your request was unclear but it sounded like you wanted to
  rs> manipulate strings using a pointer to the end rather than the
  rs> start.

Sorry; I thought it was more clear.  strcat() (for example) determines
the end of the string by looking for the nul char.  strncat() determines
the end of the string by either the nul char, or a maximum length.

I'm looking for functions that determine the end of the string by being
provided a pointer to the end of the string.


I suppose I could use strncat() and provide the length as (endp-startp).
But this seems like extra work and I'd need to write a bunch of new
strn*() functions anyway, since most str*() functions don't have a
standard strn*() counterpart anyway.

And, strn*() has some odd behaviors.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

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