Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Sức khỏe - Y tế
Văn bản luật
Nông Lâm Ngư
Kỹ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Giới thiệu
Đăng ký
Đăng nhập
Tìm
Danh mục
Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Y tế sức khỏe
Văn bản luật
Nông lâm ngư
Kĩ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Thông tin
Điều khoản sử dụng
Quy định bảo mật
Quy chế hoạt động
Chính sách bản quyền
Giới thiệu
Đăng ký
Đăng nhập
0
Trang chủ
Công Nghệ Thông Tin
Kỹ thuật lập trình
Lecture Introduction to Computer Programming - Lecture 29
Đang chuẩn bị liên kết để tải về tài liệu:
Lecture Introduction to Computer Programming - Lecture 29
Thùy Mi
83
1
pptx
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
The contents of this chapter include all of the following: Collections provided in System.Collections namespace, collections store object reference, traversal supported, ArrayList can be sorted. | CSC141- Introduction to Computer Programming Teacher: AHMED MUMTAZ MUSTEHSAN Lecture – 29 Thanks for Lecture Slides: http://www.deitel.com/Books/C/CHowtoProgram7e/tabid/3635/Default.aspx 1 File Processing (Continued) 2 Random-Access Files Random access files Access individual records without searching through other records Instant access to records in a file Data can be inserted without destroying other data Data previously stored can be updated or deleted without overwriting Implemented using fixed length records Sequential files do not have fixed length records 0 200 300 400 500 byte offsets } } } } } } } 100 100 bytes 100 bytes 100 bytes 100 bytes 100 bytes 100 bytes 3 Creating a Randomly Accessed File Data in random access files Unformatted (stored as "raw bytes") All data of the same type (int, for example) uses the same amount of memory All records of the same type have a fixed length Data not human readable 4 Creating a Randomly Accessed File Unformatted I/O functions fwrite Transfer bytes from a location in memory to a file fread Transfer bytes from a file to a location in memory Example: fwrite( &number, sizeof( int ), 1, myPtr ); &number – Location to transfer bytes from sizeof( int ) – Number of bytes to transfer 1 – For arrays, number of elements to transfer In this case, "one element" of an array is being transferred myPtr – File to transfer to or from 5 Creating a Randomly Accessed File Writing structs fwrite( &myObject, sizeof (struct myStruct), 1, myPtr ); sizeof – returns size in bytes of object in parentheses To write several array elements Pointer to array as first argument Number of elements to write as third argument 6 /* Fig. 11.11: fig11_11.c #include /* clientData structure definition */ struct clientData { int acctNum; /* account number */ char lastName[ 15 ]; /* account last name */ char firstName[ 10 ]; /* account first name */ double balance; /* account balance */ }; /* end structure clientData */ int main( void ) { int i; | CSC141- Introduction to Computer Programming Teacher: AHMED MUMTAZ MUSTEHSAN Lecture – 29 Thanks for Lecture Slides: http://www.deitel.com/Books/C/CHowtoProgram7e/tabid/3635/Default.aspx 1 File Processing (Continued) 2 Random-Access Files Random access files Access individual records without searching through other records Instant access to records in a file Data can be inserted without destroying other data Data previously stored can be updated or deleted without overwriting Implemented using fixed length records Sequential files do not have fixed length records 0 200 300 400 500 byte offsets } } } } } } } 100 100 bytes 100 bytes 100 bytes 100 bytes 100 bytes 100 bytes 3 Creating a Randomly Accessed File Data in random access files Unformatted (stored as "raw bytes") All data of the same type (int, for example) uses the same amount of memory All records of the same type have a fixed length Data not human readable 4 Creating a Randomly Accessed File Unformatted I/O functions fwrite .
TÀI LIỆU LIÊN QUAN
Lecture Introduction to Computer Programming - Lecture 8
Lecture Introduction to Computer Programming - Lecture 9
Lecture Introduction to Computer Programming - Lecture 26
Lecture Introduction to Computer Programming - Lecture 28
Lecture Introduction to Computer Programming - Lecture 29
Lecture Introduction to Computer Programming - Lecture 30
Lecture Introduction to Computer Programming - Lecture 31
Lecture Introduction to computer and programming - Lecture No 6
Lecture Introduction to computer and programming - Lecture No 8
Lecture Introduction to computer and programming - Lecture No 9
crossorigin="anonymous">
Đã 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.