tailieunhanh - Lecture Introduction to Computer Programming - Lecture 31

This chapter introduced inheritancethe ability to create classes by absorbing an existing class's members and enhancing them with new capabilities. You learned the notions of base classes and derived classes and created a derived class that inherits members from a base class. The chapter introduced access modifier protected; derived class methods can access protected base class members;. Finally, you learned about Software Engineering with Inheritance. | CSC141- Introduction to Computer Programming Teacher: AHMED MUMTAZ MUSTEHSAN Lecture – 31 Thanks for Lecture Slides: C How to Program by Paul Deital & Harvey Deital 6Ed. 1 iostream Continued istream Member Functions peek, putback and ignore ignore member function Skips over a designated number of characters (default of one) Terminates upon encountering a designated delimiter (default is EOF, skips to the end of the file) putback member function Places the previous character obtained by get back in to the stream. peek Returns the next character from the stream without removing it CSC 141 Introduction to computer Programming 3 Type-Safe I/O > operators Overloaded to accept data of different types When unexpected data encountered, error flags set Program stays in control CSC 141 Introduction to computer Programming 4 Unformatted I/O with read, gcount and write read and write member functions Unformatted I/O Input/output raw bytes to or from a character array in memory Since the data is unformatted, the functions will not terminate at a newline character for example Instead, like getline, they continue to process a designated number of characters If fewer than the designated number of characters are read, then the failbit is set gcount: Returns the total number of characters read in the last input operation CSC 141 Introduction to computer Programming 5 Enter a sentence: Using the read, write and gcount member functions The sentence entered was: Using the read, writ Output Stream Manipulators Stream manipulator capabilities Setting field widths Setting precisions Setting and unsetting format flags Setting the fill character in fields Flushing streams Inserting a newline in the output stream and flushing the stream Inserting a null character in the output stream and skipping whitespace in the input stream CSC 141 Introduction to computer Programming 7 Integral Stream Base: dec, oct, hex and | CSC141- Introduction to Computer Programming Teacher: AHMED MUMTAZ MUSTEHSAN Lecture – 31 Thanks for Lecture Slides: C How to Program by Paul Deital & Harvey Deital 6Ed. 1 iostream Continued istream Member Functions peek, putback and ignore ignore member function Skips over a designated number of characters (default of one) Terminates upon encountering a designated delimiter (default is EOF, skips to the end of the file) putback member function Places the previous character obtained by get back in to the stream. peek Returns the next character from the stream without removing it CSC 141 Introduction to computer Programming 3 Type-Safe I/O > operators Overloaded to accept data of different types When unexpected data encountered, error flags set Program stays in control CSC 141 Introduction to computer Programming 4 Unformatted I/O with read, gcount and write read and write member functions Unformatted I/O

TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
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.