Yurttas/PL/OOL/Cplusplus/F/03/01/02/00/F.h
Jump to navigation
Jump to search
1/*
2 Copyright(C) 1998
3 All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..
4
5 Permission to use, copy, modify, and distribute this
6 software and its documentation for EDUCATIONAL purposes
7 and without fee is hereby granted provided that this
8 copyright notice appears in all copies.
9
10 date : January 1, 1998.
11 author : Salih Yurttas.
12
13 F.h
14*/
15
16
17#include <iostream>
18
19using namespace std;
20
21class F {
22public:
23 F(const int a=2, // default constructor with default values
24 const int b=1);
25
26 F(const F&); // copy constructor
27
28 F& operator=(const F&); // assignment operator overloaded
29
30 virtual ~F(); // destructor
31
32 virtual int get_s() const; // accessor for s
33
34 virtual int* get_d() const; // accessor for d
35
36 virtual void set_d(const int); // mutator for d by an int
37
38 virtual void set_d(const int,
39 const int); // mutator for d by distinct ints
40
41 virtual void set_d(const int*); // mutator for d by aggregate of ints
42
43 friend ostream& operator<<(ostream&,
44 const F&); // F type output
45
46protected:
47 int s;
48 int* d;
49};