-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathC4Col.h
More file actions
31 lines (23 loc) · 916 Bytes
/
C4Col.h
File metadata and controls
31 lines (23 loc) · 916 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Marya Poterek
// Interface for C4Col class
// C4Col.h
// CSE 20312
/* C4Col class interface that uses dynamic memory allocation. An object of this class is instantiated in the C4Board class using composition
*/
#ifndef C4COL_H
#define C4COL_H
#include<iostream>
class C4Col {
public:
C4Col(); //Default constructor
~C4Col(); //Destructor
int isFull(); //Determines if column is full
char getDisc(int); //Returns requested element of private char array
int getMaxDiscs(); //Returns max number of discs (num of rows)
void addDisc(char); //Adds char representing disc to next open slot in array
private:
int numDiscs; //Number of discs present in a column
int maxDiscs; //Maximum number of discs in a column
char * Discs; //Point at elements of array & is elements of array- not reserved memory space
};
#endif