Object-oriented Programming in C++This introduction to object-oriented programming in C++ demonstrates how to implement object-oriented design in C++. It covers current features such as: templates, multiple inheritance, C++ streams and exception handling. Features include: assertions and program correctness; sample applications; and end-of-chapter sections which discuss common programming errors. |
From inside the book
Results 1-3 of 7
Page 105
... [ MinZip + 1 ] ; // +1 for terminator for ( int i = 0 ; i < MinZip ; i ++ ) code [ i ] = InitChar ; code [ i ] = ' \ 0 ' ; allocates MinZip + 1 bytes and stores InitChar , currently the character ? , in MinZip of the cells and the null ...
... [ MinZip + 1 ] ; // +1 for terminator for ( int i = 0 ; i < MinZip ; i ++ ) code [ i ] = InitChar ; code [ i ] = ' \ 0 ' ; allocates MinZip + 1 bytes and stores InitChar , currently the character ? , in MinZip of the cells and the null ...
Page 509
... MinZip ) char temp BigZip + 1 ] ; // save original strcpy ( temp , code ) ; delete [ ] code ; // shorten code = new char [ MinZip + 1 ] ; strncpy ( code , temp , MinZip ) ; code [ MinZip ] = ' \ 0 ' ; // extract 5 - digit ZipC and ...
... MinZip ) char temp BigZip + 1 ] ; // save original strcpy ( temp , code ) ; delete [ ] code ; // shorten code = new char [ MinZip + 1 ] ; strncpy ( code , temp , MinZip ) ; code [ MinZip ] = ' \ 0 ' ; // extract 5 - digit ZipC and ...
Page 512
... [ MinZip + 1 ] ; for ( int i = 0 ; i < MinZip ; i ++ ) code [ i ] = InitChar ; code [ i ] = ' \ 0 ' ; assert ( strlen ( code ) == MinZip && ZipC_inv ) ; ZipC :: ZipC ( const char * zipstr ) { int len = strlen ( zipstr ) < = MaxZip ) ...
... [ MinZip + 1 ] ; for ( int i = 0 ; i < MinZip ; i ++ ) code [ i ] = InitChar ; code [ i ] = ' \ 0 ' ; assert ( strlen ( code ) == MinZip && ZipC_inv ) ; ZipC :: ZipC ( const char * zipstr ) { int len = strlen ( zipstr ) < = MaxZip ) ...
Other editions - View all
Common terms and phrases
abstract class abstract data type argument assignment operator base class binary BMark buff bytes cells character array character buffer class D public class declaration class invariant class object class String code slice class compiler Computer const char const int const String& copy constructor cout created cstr data type default constructor defined delete derived class destructor dynamically allocated EmptyStack endl Example Explain the error Figure flags float friend functions fstreambase header file Implement include iostream.h include stdlib.h information hiding inheritance hierarchy initialize input/output int main integer invoked IterBST keyword MaxStack multiple inheritance Node null terminator object-oriented operator+ ostrstream parameter pointer protected return EXIT_SUCCESS run-time Section Smalltalk stack class standard output static data member stdio.h strcmp strcpy stream String s1 String::operator String::String strlen syntax traverse tree type conversion typeid variable virtual method virtual void void f write