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

Đặc biệt, dấu ngoặc đơn được sử dụng để chỉ chức năng, và chúng được sử dụng cho mục đích làm tổ (để thiết lập ưu tiên) trong tờ khai phức tạp hơn. Vì vậy, khai báo int * p (int a); cho thấy một chức năng mà chấp nhận một đối số số nguyên, và trả về một con trỏ đến một số nguyên. | CHAP. 11 STRUCTURES AND UNIONS 377 else mark the node following the target node temp tag- next- next free space for the target node free tag- next adjust the link to the next node tag- next temp return first The program begins with the usual flinclude statements and a definition of the symbolic constant NULL to represent the value 0. Following these statements is a declaration for the self-referential structure list_element. This structure declaration is the same as that shown in Example . Thus list_element identifies a structure consisting of two members a 40-element character array item and a pointer next to another structure of the same type. The character array will represent a string and the pointer will identify the location of the next component in the linked list. The data type node is then defined identifying structures having composition list_element. This definition is followed by the function prototypes. Within the function prototypes notice that start is a pointer to a structure of type node. This pointer will indicate the beginning of the linked list. The remaining function prototypes identify several additional functions that are called from main. Note that these declarations and function prototypes are external. They will therefore be recognized throughout the program. The main function consists of a do - while loop that permits repetitious execution of the entire process. This loop calls the function menu which generates the main menu and returns a value for choice indicating the user s menu selection. A switch statement then calls the appropriate functions in accordance with the user s selection. Notice that the program will stop executing if choice is assigned a value of 4. If choice is assigned a value of 1 indicating that a new linked list will be created a block of memory must be allocated for the first data item before calling the function create. This is accomplished using the library function malloc as discussed in Sec. . Thus .

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.