next up previous
Next: C++ Implementation 7/11 Up: Von C++ zu Java Previous: C++ Implementation 5/11

C++ Implementation 6/11

Counter.cc

#include "Counter.h"

int Counter::the_counter_no;

void Counter::prelude(void)
{
  the_counter_no = 0;
}

Counter::Counter()
{
  the_colour = INVISIBLE;
}

Counter::Counter(const int dummy)
{
  the_colour = "xo*+#"[the_counter_no++];
}

Counter::Counter(const char representation)
{
  the_colour = representation;
}

char Counter::colour(void) const
{
  return the_colour;
}

void Counter::display(void) const
{
  cout << the_colour;
}


next up previous
Next: C++ Implementation 7/11 Up: Von C++ zu Java Previous: C++ Implementation 5/11

© 1997 Gottfried Rudorfer, C++-AG, Lehrveranstaltungen, Abteilung für Angewandte Informatik, Wirtschaftsuniversität Wien, 3/19/1998