Skip to content
EntityQ7623901· pop 9· linked from 65 articles

String (C++标准库)

Sign in to save

Also known as string, C++ string

class in the C++ standard library that represents a string of characters

Article · 中文

是C++標準程式庫中的一個头文件,定义了C++标准中的字符串的基本模板类std::basic_string及相关的模板类实例: 其中的string是以char作为模板参数的模板类实例,把字符串的内存管理责任由string负责而不是由编程者负责,大大减轻了C语言风格的字符串的麻烦。 std::basic_string提供了大量的字符串操作函数,如比较、连接、搜索、替换、获得子串等。并可与C语言风格字符串双向转换。std::basic_string属于C++ STL容器类,用户自定义的类也可以作为它的模板参数,因此也适用C++ STL Algorithm库。 string本质上是以字符作为元素的vector特化版本;不存在0字符结尾这个概念,能装入'\0'这种数据。

Abstract from DBpedia / Wikipedia · CC BY-SA

Available in 5 languages

via Wikidata sitelinks · CC0

Connections

Categories