12.05.2015 Views

type - David Vernon

type - David Vernon

type - David Vernon

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Object-Oriented Programming<br />

A Class for Sets - Application<br />

// ISET.H: Header file for set operations<br />

// (interface; file name: iset.h)<br />

#include “iostream.h”<br />

class iset {<br />

public:<br />

iset() // constructor to begin<br />

{ a = NULL; // with empty set<br />

n = 0;<br />

}<br />

iset(int x) // constructor to begin<br />

{ a = NULL; // with one element x<br />

*this += x;<br />

n = 1;<br />

}<br />

~iset() // destructor<br />

{ delete[] a;<br />

}<br />

Copyright © 2007 <strong>David</strong> <strong>Vernon</strong> (www.vernon.eu)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!