home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
OTHERUTI
/
TCPP30-3.ZIP
/
EXAMPLES.ZIP
/
LIST.H
< prev
next >
Wrap
C/C++ Source or Header
|
1992-02-18
|
644b
|
24 lines
// Borland C++ - (C) Copyright 1991 by Borland International
// list.h: A Integer List Class
// from Hands-on C++
const int Max_elem = 10;
class List
{
int *list; // An array of integers
int nmax; // The dimension of the array
int nelem; // The number of elements
public:
List(int n = Max_elem) {list = new int[n]; nmax = n; nelem = 0;};
~List() {delete list;};
int put_elem(int, int);
int get_elem(int&, int);
void setn(int n) {nelem = n;};
int getn() {return nelem;};
void incn() {if (nelem < nmax) ++nelem;};
int getmax() {return nmax;};
void print();
};