设为首页 加入收藏

TOP

CHAPTER 3 STRINGS, VECTORS , AND ARRAYS
2013-10-07 16:19:19 来源: 作者: 【 】 浏览:69
Tags:CHAPTER STRINGS VECTORS AND ARRAYS

Section 3.1 Namespace usingDeclarations . . . . . . 82

Section 3.2 Library stringType . . . . . . . . . . . . . 84

Section 3.3 Library vectorType . . . . . . . . . . . . . 96

Section 3.4 Introducing Iterators . . . . . . . . . . . . . 106

Section 3.5 Arrays . . . . . . . . . . . . . . . . . . . . . . 113

Section 3.6 Multidimensional Arrays . . . . . . . . . . 125

ChapterSummary . . . . . . . . . . . . . . . . . . . . . . 131

DefinedTerms . . . . . . . . . . . . . . . . . . . . . . . . . 131

In addition to the built-in types covered in Chapter 2, C++(www.cppentry.com) defines a rich library of abstract data types. Among the most important library types are string, which supports variable-length character strings, and vector, which defines variable-size collections. Associated with string and vector are companion types known as iterators, which are used to access the haracters in a string or the elements in a vector.

The string and vector types defined by the library are abstractions of the more primitive built-in array type. This chapter covers arrays and introduces the library vector and string types. The built-in types that we covered in Chapter 2 are defined directly by the C++(www.cppentry.com) language. These types represent facilities present in most computer hardware, such as numbers or characters. The standard library defines a number of additional types of a higher-level nature that computer hardware usually does not implement directly.

In this chapter, we’ll introduce two of the most important library types: string and vector. A string is a variable-length sequence of characters. A vector holds a variable-length sequence of objects of a given type. We’ll also cover the built-in array type. Like other built-in types, arrays represent facilities of the hardware. As a result, arrays are less convenient to use than the library string and vector types.

Before beginning our exploration of the library types, we’ll look at amechanism for simplifying access to the names defined in the library.

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇2.6 Defining Our Own Data Struc.. 下一篇3.1 Namespace using Declarations

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·用 Python 进行数据 (2025-12-25 15:49:09)
·如何学习Python数据 (2025-12-25 15:49:07)
·利用Python进行数据 (2025-12-25 15:49:04)
·Java 学习线路图是怎 (2025-12-25 15:19:15)
·关于 Java 学习,有 (2025-12-25 15:19:12)