Đang chuẩn bị liên kết để tải về tài liệu:
Lecture Introduction to Computer Programming - Lecture 31

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

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. http://www.deitel.com/Books/C/CHowtoProgram7e/tabid/3635/Default.aspx 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. http://www.deitel.com/Books/C/CHowtoProgram7e/tabid/3635/Default.aspx 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