[Serdev] ENUM enhancements
Greger V. Teigre
greger at teigre.com
Tue Jun 21 15:20:23 UTC 2005
Function: void * memmem (const void *haystack, size_t haystack-len,
const void *needle, size_t needle-len)
This is like strstr, but needle and haystack are byte arrays rather than
null-terminated strings. needle-len is the length of needle and haystack-len
is the length of haystack.
This function is a GNU extension.
Juha Heinanen wrote:
> Klaus Darilion writes:
>
>> My code works, but it was not that easy as I thought (probably due
>> to my weak C skills). I could not find any function that searches a
>> character in a string without terminating \0. Thus I copied the str
>> into a \0 terminated string first. Also it bloated up the code.
>
> write your own function that does the search. copying should always
> be avoided if at all possible.
>
> -- juha
>
> _______________________________________________
> Serdev mailing list
> serdev at lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serdev
More information about the Serdev
mailing list