TAILIEUCHUNG - Lecture Introduction to computer and programming - Lecture No 30

The contents of this chapter include all of the following: Can conditionally compile code, can control line numbers and file names reported by compiler, can emit warnings and errors, can define logical regions of source code. | CSC103: Introduction to Computer and Programming Lecture No 30 Previous lecture Database Management system Adding a record Displaying all records Modify a record Delete a record Seeking in file through fseek ( ) function Today’s lecture outline Database management program Console I/O formatting sprintf ( ) and sscanf( ) Database management program It is capable to Add record : make sure that file pointer points to end of file Display record : make sure that file pointer point to the beginning of file Modify record : make sure that file pointer point to the beginning of file Delete record : make sure that file pointer point to the beginning of file Go to program Console formatting The screen and keyboard together are called a console Console I/O functions can be further classified into two categories—formatted and unformatted console I/O functions. Name Roll No CGPA Ali 102 Ahmad Unformatted output Name Roll No CGPA Ali 102 Ahmad Formatted output Console I/O function Formatted function Unformatted function Type Input Output char scanf( ) printf( ) int scanf( ) printf( ) float scanf( ) printf( ) string scanf( ) printf( ) Type Input Output char getch( ) getche( ) getchar( ) putch( ) putchar( ) int - float - string gets( ) puts( ) Formatted Console I/O Functions General form of printf ( ) function printf( “formatted string”, list of variables); Formatted string contains Characters that are simply printed as they are Conversion specifications that begin with a % sign Escape sequences that begin with a \ sign Character printed as they are % sign for variable values Escape sequence Format Specifications %d %c and %f used in the printf( ) are called format specifiers They tell printf( ) function the type of value of a variable C language provide following optional specifiers in the format specifications Specifier Description dd digits specifying field width . separating field width from precision dd Digit specifying precision - Sign for .

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.