//: C07:Stash3.h
// From Thinking in C++, 2nd Edition
// Available at http://www.BruceEckel.com
// (c) Bruce Eckel 2000
// Copyright notice in Copyright.txt
// Function overloading
#ifndef STASH3_H
#define STASH3_H
class Stash
{
/* Size of each space */
int size;
/* Number of storage spaces */
int quantity;
/* Next empty space */
int next;
/* Dynamically allocated array of bytes: */
unsigned char* storage;
void inflate(int increase);
/* In questo caso, al contrario del precedente file Clib.h, si usano costruttori e un distruttori, al posto delle funzioni "initialize" e "cleanup". Come si puņ vedere si hanno 2 costruttori. */
public:
/* Zero quantity */
Stash(int size);
Stash(int size, int initQuantity);
~Stash();
int add(void* element);
void* fetch(int index);
int count();};
#endif // STASH3_H ///:~