Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
Array1.h
Package: fig08_04.zip [view]
Upload User: okapple
Upload Date: 2021-05-13
Package Size: 3k
Code Size: 1k
Category:
Compress-Decompress algrithms
Development Platform:
C/C++
- // Fig. 8.4: array1.h
- // Simple class Array (for integers)
- #ifndef ARRAY1_H
- #define ARRAY1_H
- #include <iostream.h>
- class Array {
- friend ostream &operator<<( ostream &, const Array & );
- friend istream &operator>>( istream &, Array & );
- public:
- Array( int = 10 ); // default constructor
- Array( const Array & ); // copy constructor
- ~Array(); // destructor
- int getSize() const; // return size
- const Array &operator=( const Array & ); // assign arrays
- bool operator==( const Array & ) const; // compare equal
- // Determine if two arrays are not equal and
- // return true, otherwise return false (uses operator==).
- bool operator!=( const Array &right ) const
- { return ! ( *this == right ); }
- int &operator[]( int ); // subscript operator
- const int &operator[]( int ) const; // subscript operator
- static int getArrayCount(); // Return count of
- // arrays instantiated.
- private:
- int size; // size of the array
- int *ptr; // pointer to first element of array
- static int arrayCount; // # of Arrays instantiated
- };
- #endif