Đang chuẩn bị liên kết để tải về tài liệu:
Giáo trình tin học chương 4

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Arrays • Array – Structures of related data items – Static entity (same size throughout program) – Consecutive group of memory locations – Same name and type (int, char, etc.) • To refer to an element – Specify array name and position number (index) – Format: arrayname[ position number ] – First element at position 0 | 1 Chapter 4 - Arrays Outline 4.1 Introduction 4.2 Arrays 4.3 Declaring Arrays 4.4 Examples Using Arrays 4.5 Passing Arrays to Functions 4.6 Sorting Arrays 4.7 Searching Arrays Linear Search and Binary Search 4.8 Multiple-Subscripted Arrays 2003 Prentice Hall Inc. All rights reserved. 2 Arrays Array - Structures of related data items - Static entity same size throughout program - Consecutive group of memory locations - Same name and type int char etc. To refer to an element - Specify array name and position number index - Format arrayname position number - First element at position 0 N-element array c c 0 c 1 . c n - 1 - Nth element as position N-1 2003 Prentice Hall Inc. All rights reserved. 3 Arrays Array elements like other variables - Assignment printing for an integer array c c 0 3 cout c 0 Can perform operations inside subscript c 5 - 2 same as c 3 2003 Prentice Hall Inc. All rights .