1. Trang chủ
  2. » Tất cả

Lecture introduction to computer programming chapter 9 file processing

10 0 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề File Processing
Tác giả TS. Võ Thị Ngọc Châu
Trường học Ho Chi Minh City University of Technology
Chuyên ngành Computer Science and Engineering
Thể loại Lecture introduction to computer programming
Năm xuất bản 2017 – 2018
Thành phố Ho Chi Minh City
Định dạng
Số trang 10
Dung lượng 773,47 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Chapter 9 File Processing 2017 – 2018, Semester 2 Ho Chi Minh City University of Technology Faculty of Computer Science and Engineering Introduction to Computer Programming (C language) TS Võ Thị Ngọc[.]

Trang 1

Chapter 9: File Processing

Introduction to Computer Programming

(C language)

TS Võ Thị Ngọc Châu (chauvtn@cse.hcmut.edu.vn,

chauvtn@hcmut.edu.vn)

Trang 2

Course Content

Programming

Components

Trang 3

References

Deitel and Harvey Deitel, Prentice Hall, 2012

– Brian W Kernighan and Dennis M Ritchie, Prentice Hall, 1988

Trang 4

4

Content

 Introduction

 Declare files

 Open and close files

 Store and retrieve data from files

 Use macros

 Summary

Trang 5

Recall – Chapter 3 and Chapter 8

Uninitialized data

.bss

Initialized data

.data

Code

.text

Stack

Heap

Read from program file

by exec

Initialized to

zero by exec

Command-line arguments

and environment variables

Higher address

Lower address

Local variables, arguments,

grown/shrunk with function calls

Grown/shrunk with dynamic

allocation and de-allocation

Uninitialized (static) global

variables, static local variables

Initialized (static) global variables,

static local variables, constants

Machine code, often read-only

Trang 6

Introduction

 Temporary as lost when a program terminates !!!

after program execution?

drives, CDs, DVDs, flash drives, …)

6

Trang 7

Introduction

Files on hard drives

data1.txt data2.txt

Trang 8

Introduction

8

Figure 11.1 Data hierarchy

[1], pp 419

Trang 9

Introduction

a specific byte number recorded in a

system-maintained, administrative data structure

file

files and programs

Figure 11.2 C’s view of a file of n bytes

Trang 10

Introduction

bytes

beginning of the file

10

Figure 11.10: C’s view of a random-access file

[1], pp 431

Ngày đăng: 25/02/2023, 03:58

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN