1 / 166
文档名称:

【工具辅导类】C++ By Example(五).pdf

格式:pdf   页数:166
下载后只包含 1 个 PDF 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

【工具辅导类】C++ By Example(五).pdf

上传人:中国课件站 2011/7/19 文件大小:0 KB

下载得到文件列表

【工具辅导类】C++ By Example(五).pdf

文档介绍

文档介绍:Part V
Arrays and Pointers
C++ By
23EXAMPLE
Introducing Arrays
This chapter discusses different types of arrays. You are already
familiar with character arrays, which are the only method for storing
character strings in the C++ language. A character array isn’t the
only kind of array you can use, however. There is an array for every
data type in C++. By learning how to process arrays, you greatly
improve the power and efficiency of your programs.
This chapter introduces
♦ Array basics of names, data types, and subscripts
♦ Initializing an array at declaration time
♦ Initializing an array during program execution
♦ Selecting elements from arrays
The sample programs in these next few chapters are the most
advanced that you have seen in this book. Arrays are not difficult to
use, but their power makes them well-suited to more advanced
programming.
473
Chapter 23 ♦ Introducing Arrays
Array Basics
An array is a list of Although you have seen arrays used as character strings, you
more than one still must have a review of arrays in general. An array is a list of more
variable having the
same name. than one variable having the same name. Not all lists of variables are
arrays. The following list of four variables, for example, does not
qualify as an array.
sales bonus_92 first_initial ctr
This is a list of variables (four of them), but it isn’t an array
because each variable has a different name. You might wonder how
more than one variable can have the same name; this seems to violate
the rules for variables. If two variables have the same name, how can
C++ determine which you are referring to when you use that name?
Array variables, or array elements, are differentiated by a
subscript, which is a number inside brackets. Suppose you want to
store a person’s name in a character array called name. You can do
this with
char name[] = “Ray Krebbs”;
or
char name[11] = “Ray Krebbs”;
Because C++ reserves an

最近更新

2024年柳州职业技术学院单招职业适应性考试模.. 40页

2024年武夷山职业学院单招职业适应性考试题库.. 41页

2024年毕节医学高等专科学校单招综合素质考试.. 42页

2024年江苏电子信息职业学院单招职业倾向性考.. 41页

2024年江苏省连云港市单招职业倾向性测试模拟.. 40页

2024年江西交通职业技术学院单招职业倾向性测.. 41页

2024年江西应用工程职业学院单招职业倾向性考.. 41页

2024年江西枫林涉外经贸职业学院单招职业技能.. 41页

2024年江西电力职业技术学院单招职业适应性测.. 43页

2024年江西科技学院单招职业倾向性考试模拟测.. 40页

2024年沙洲职业工学院单招职业适应性测试模拟.. 40页

2024年河北劳动关系职业学院单招职业适应性测.. 39页

2024年河北建材职业技术学院单招职业倾向性测.. 40页

2024年河南中医药大学单招职业适应性考试模拟.. 40页

2024年河南对外经济贸易职业学院单招职业倾向.. 41页

2024年河南推拿职业学院单招职业适应性测试模.. 42页

2024年河南省信阳市单招职业适应性测试题库最.. 37页

2024年河源职业技术学院单招职业倾向性测试模.. 41页

2024年泉州经贸职业技术学院单招综合素质考试.. 39页

2024年泸州职业技术学院单招职业倾向性考试题.. 40页

2024年济宁职业技术学院单招职业适应性考试模.. 39页

2024年浙江农林大学单招职业适应性测试题库附.. 40页

2024年浙江工业大学之江学院单招职业适应性测.. 41页

2024年浙江省衢州市单招职业适应性考试题库附.. 40页

2024年浙江艺术职业学院单招职业倾向性考试模.. 41页

2024年海南经贸职业技术学院单招职业倾向性考.. 42页

2024年淮南职业技术学院单招职业技能考试题库.. 40页

2024年湄洲湾职业技术学院单招职业适应性考试.. 40页

2025年广州卫生职业技术学院单招职业技能测试.. 64页

美团代运营业务委托合同 6页