I am writing a program for a class and am specifically working on part of my code. I am trying to write a bool isFull class member function( I believe that is the correct name). Here are the errors:
p2.cpp: In function `void readWords(std::ifstream&, int&, WordList&)':
p2.cpp:128: error: 'class WordList' has no member named 'isFull'
Header file code:
1 2 3 4 5 6 7
//*************************isFull***********************************
// Name: isFull
// Description: returns true if array is full, returns false if empty
// Parameters:
// Return: true
//****************************************************************
bool isFull();
.cpp file code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
//*************************isFull********************************************
//may not have this written right???
bool WordList::isFull() {
countW = 0;
constint MAX_WORDS = 1000;
if (countW == MAX_WORDS)
return(true); //is full
elsereturn(false); //is not full
}
The application file code where I am trying to "call" it:
Yes - I fixed this with some help but the countW being set to 0 was part of the problem.
.h file
1 2 3 4 5 6 7
//*************************isFull*******************************
// Name: isFull
// Description: returns true if array is full, returns false if empty
// Parameters:
// Return: true
//************************************************************
bool isFull();
In the .cpp file:
1 2 3 4 5 6 7 8 9 10 11 12 13
//*************************isFull****************************
bool WordList::isFull() {
int WordCount = getNumWords();
constint MAX_WORDS = 1000;
if (WordCount == MAX_WORDS)
return(true); //is full
elsereturn(false); //is not full
}