tailieunhanh - Lecture Practical C++ programming - Chapter 5: Arrays, qualifiers, and reading numbers

In the previous chapter students were introduced to the simple variable and the output statement. In this chapter we expand on that knowledge by introducing them to the array type and the input statement. Inviting you refer. | Chapter - 5 Arrays Qualifiers and Reading Numbers Practical C Programming Copyright 2003 O Reilly and Associates Page1 r -J Arrays Simple variables allow user to declare one item such as a single width If we have a number of similar items we can use an array to declare them. For example if we want declare a variable to hold the widths of 1000 rectangles. The width of the first rectangle is width 0 the width of the second rectangle is width 1 and so on until width 999 . Warning Common sense tells you that the last element of the width array is width 1000 . Common sense has nothing to do with programming and the last element of the array is width 999 . Practical C Programming Copyright 2003 O Reilly and Associates Page2 ru JJ r J -I L. Computing the average of 6 numbers int main Practical C Programming Copyright 2003 O Reilly and Associates .