字符串搜索算法使用string :: find()c ++ [英] String search algorithm used by string::find() c++

查看:541
本文介绍了字符串搜索算法使用string :: find()c ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它如何比cstring函数快?是类似的源C?

how its faster than cstring functions? is the similar source available for C?

推荐答案

没有C ++标准库的标准实现,但你应该能够看看你的编译器附带的实现,看看它是如何工作的自己。

There's no standard implementation of the C++ Standard Library, but you should be able to take a look at the implementation shipped with your compiler and see how it works yourself.

一般来说,大多数STL函数不比它们的C对应的速度更快。它们通常更安全,更一般化,并设计为适应比狭义目的C等同物更广泛的情况。

In general, most STL functions are not faster than their C counterparts, though. They're usually safer, more generalized and designed to accommodate a much broader range of circumstances than the narrow-purpose C equivalents.

这篇关于字符串搜索算法使用string :: find()c ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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