TAILIEUCHUNG - Lecture Introduction to Computer Programming - Lecture 28

The contents of this chapter include all of the following: Assembly is the component of the CLR, assembly identity made of four components, application typically made of several assemblies. | CSC141- Introduction to Computer Programming Teacher: AHMED MUMTAZ MUSTEHSAN Lecture – 28 Thanks for Lecture Slides: 1 Introduction Storage of data in variables and arrays is only temporary Data files Can be created, updated, and processed by C programs Are used for permanent storage of large amounts of data 2 The Data Hierarchy Data Hierarchy: Bit – smallest data item Value of 0 or 1 Byte – 8 bits Used to store a character Decimal digits, letters, and special symbols Field – group of characters conveying meaning Example: your name Record – group of related fields Represented by a struct or a class Example: In a payroll system, a record for a particular employee that contained his/her identification number, name, address, etc. 3 The Data Hierarchy Data Hierarchy (continued): File – group of related records Example: payroll file Database – group of related files DBMS 4 The Data Hierarchy Data files Record key Identifies a record to facilitate the retrieval of specific records from a file Sequential file Records typically sorted by key 5 Files and Streams C views each file as a sequence of bytes File ends with the end-of-file marker Or, file ends at a specified byte Stream created when a file is opened Provide communication channel between files and programs Opening a file returns a pointer to a FILE structure Example file pointers: stdin - standard input (keyboard) stdout - standard output (screen) stderr - standard error (screen) 6 Files and Streams FILE structure File descriptor Index into operating system array called the open file table File Control Block (FCB) Found in every array element, system uses it to administer the file 7 Files and Streams 8 Files and Streams Read/Write functions in standard library fgetc Reads one character from a file Takes a FILE pointer as an argument fgetc( stdin ) equivalent to getchar() fputc Writes one character to a file Takes a FILE pointer and a character to

TỪ KHÓA LIÊN QUAN
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.