Chapter6–Arrays(阵列).ppt

Chapter6–Arrays(阵列).ppt

Chapter 6 – Arrays ( 陣 列 ) Objectives 6.1 Introduction Arrays Structures of related data items Static entity – same size throughout program Dynamic data structures discussed in Chapter 12 6.2 Arrays Array (陣列) Group of consecutive memory locations Same name and type To refer to an element (元素) , need to specify Array name (陣列名稱) Position number (位置編號、位置號碼), or the subscript (足標、索引值) Format: arrayname[ position number ] First element at position 0 (編號從 0 開始) n element array named c: c[ 0 ], c[ 1 ]...c[ n – 1 ] 6.2 Arrays Array elements are like normal variables c[ 0 ] = 3; printf( %d, c[ 0

文档评论(0)

1亿VIP精品文档

相关文档