Giáo trình tin học chương IV

33 638 2
Giáo trình tin học chương IV

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Giáo trình tin học chương IV

1 Chapter - Arrays Outline 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 Introduction Arrays Declaring Arrays Examples Using Arrays Passing Arrays to Functions Sorting Arrays Searching Arrays: Linear Search and Binary Search Multiple-Subscripted Arrays  2003 Prentice Hall, Inc All rights reserved 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 • N-element array c c[ ], c[ ] … c[ n - ] – Nth element as position N-1  2003 Prentice Hall, Inc All rights reserved Arrays • Array elements like other variables – Assignment, printing for an integer array c c[ ] = 3; cout

Ngày đăng: 22/08/2012, 10:13

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan