Lecture Introduction to Computer Programming - Lecture 17

The contents of this chapter include all of the following: Define virtual memory; describe the hardware and control structures that support virtual memory; describe the various OS mechanisms used to implement virtual memory; describe the virtual memory management mechanisms in UNIX, Linux, and Windows 7. | CSC141- Introduction to Computer programming Teacher: AHMED MUMTAZ MUSTEHSAN Lecture – 17 Thanks for Lecture Slides: 2003 Prentice Hall, Inc. 1 Arrays a Quick revision Arrays Structures of related data items Static allocation (same size throughout program) Array is a consecutive allocation of memory locations. Each element has the same name and the same data type such as (int, char, float or double) How to access an element? Use array name and position number (index) Generic Format: name[ position ] First element is at position 0 Concepts to remember An array of N-Elements a[ 0 ], a[ 1 ] a[ n - 1 ] Last (nth element at position n-1) Use array elements like other variables Example of using an integer array a a[ 3 ] = 5; cout . | CSC141- Introduction to Computer programming Teacher: AHMED MUMTAZ MUSTEHSAN Lecture – 17 Thanks for Lecture Slides: 2003 Prentice Hall, Inc. 1 Arrays a Quick revision Arrays Structures of related data items Static allocation (same size throughout program) Array is a consecutive allocation of memory locations. Each element has the same name and the same data type such as (int, char, float or double) How to access an element? Use array name and position number (index) Generic Format: name[ position ] First element is at position 0 Concepts to remember An array of N-Elements a[ 0 ], a[ 1 ] a[ n - 1 ] Last (nth element at position n-1) Use array elements like other variables Example of using an integer array a a[ 3 ] = 5; cout << a[ 3 ]; May use expressions to replace subscript A [ 2 + 3 ] is equal to a[5] Pictorial form of an Arrays a[6] -76 6 0 72 1543 -89 0 62 -3 1 6453 78 a[0] a[1] a[2] a[3] a[11] a[10] a[9]

Bấm vào đây để xem trước nội dung
TÀI LIỆU MỚI ĐĂNG
427    263    2    01-07-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.