TAILIEUCHUNG - THEORY AND PROBLEMS OF PROGRAMMING WITH Second Edition phần 7

Trước khi rời chương này, chúng tôi đề cập đến việc khai báo con trỏ có thể trở thành phức tạp, và chăm sóc một số yêu cầu trong việc giải thích của họ. Điều này đặc biệt đúng với các tờ khai có liên quan đến các chức năng hoặc các mảng. Một khó khăn là việc sử dụng các dấu ngoặc kép. | 322 POINTERS CHAP. 10 Interest Rate 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Future Amount MORE ABOUT POINTER DECLARATIONS Before leaving this chapter we mention that pointer declarations can become complicated and some care is required in their interpretation. This is especially true of declarations that involve functions or arrays. One difficulty is the dual use of parentheses. In particular parentheses are used to indicate functions and they are used for nesting purposes to establish precedence within more complicated declarations. Thus the declaration int p int a indicates a function that accepts an integer argument and returns a pointer to an integer. On the other hand the declaration int p int a indicates a pointer to a function that accepts an integer argument and returns an integer. In this last declaration the first pair of parentheses is used for nesting and the second pair is used to indicate a function. The interpretation of more complex declarations can be increasingly troublesome. For example consider the declaration int p int a In this declaration p . . . indicates a pointer to a function. Hence int p . . . indicates a pointer to a function that returns a pointer to an integer. Within the last paữ of parentheses the function s argument specification a indicates a pointer to an array. Therefore int a represents a pointer to an array of integers. Putting the pieces together p int a represents a pointer to a function whose argument is a pointer to an array of integers. And finally the entire declaration int p int a represents a pointer to a function that accepts a pointer to an array of integers as an argument and returns a pointer to an integer. CHAP. 10 POINTERS 323 Remember that a left parenthesis immediately following an identifier name indicates that the identifier represents

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.