What is the difference between these two functions?

Re: strpbrk(...) vs. strcspn(...) by Jerry

Jerry
Tue May 11 08:58:21 CDT 2004

In article <730F0FF6-B855-4793-A9B5-746CC6D05F71@microsoft.com>,
anonymous@discussions.microsoft.com says...
> What is the difference between these two functions?

strcspn returns a character position where strpbrk returns a pointer.
Other than that, if no character is found, strpbrk returns a null
pointer; IIRC, under the same circumstances strcspn returns the index
of the NUL at the end of the string (which is rarely useful).

--
Later,
Jerry.

The universe is a figment of its own imagination.

Re: strpbrk(...) vs. strcspn(...) by anonymous

anonymous
Wed May 12 04:31:04 CDT 2004

I did post a message to this effect but it doesn't appear to have shown up so here goes again
Just a
_tcspbrk is the equivalent of _tcscspn, but returns a pointer rather than a size_
(both find the first character that IS in a character set from a string

what is the equivalent of _tcsspn that returns a pointer
(that finds the first character that's NOT in a character set from a string



Re: strpbrk(...) vs. strcspn(...) by Jerry

Jerry
Thu May 13 12:03:49 CDT 2004

In article <E414A812-5A66-468C-B4A1-AC3936783BD8@microsoft.com>,
anonymous@discussions.microsoft.com says...
> I did post a message to this effect but it doesn't appear to have shown up so here goes again.
> Just as
> _tcspbrk is the equivalent of _tcscspn, but returns a pointer rather than a size_t
> (both find the first character that IS in a character set from a string)
>
> what is the equivalent of _tcsspn that returns a pointer?
> (that finds the first character that's NOT in a character set from a string?

TTBOMK, the standard library doesn't contain such a thing.

--
Later,
Jerry.

The universe is a figment of its own imagination.