纯字节版本的的strstr? [英] A pure bytes version of strstr?

查看:149
本文介绍了纯字节版本的的strstr?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有中的strstr一个版本的作品在内存的固定长度,其中可能包括空字符?

Is there a version of strstr that works over a fixed length of memory that may include null characters?

我可以句话我的问题是这样的:
函数strncpy是memcpy的作为是的strstr来?

I could phrase my question like this: strncpy is to memcpy as strstr is to ?

推荐答案

将memmem,不幸的是它是GNU的具体而非标准C.然而,它是开源的,所以你可以复制code(若许可证是适合你)。

memmem, unfortunately it's GNU-specific rather than standard C. However, it's open-source so you can copy the code (if the license is amenable to you).

这篇关于纯字节版本的的strstr?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆