D
djm
i know this may seem really stupid and silly, but i just cant figure
out whats the problem with this coding. any help from you guys will be
greatly appreciated.
thanks
ive the header file and the class file which looks like this
//IndepHTable.h
#ifndef INDEPHTABLE_H
#define INDEPHTABLE_H
#include <string>
#include "List.h"
using namespace std;
const int TABLE_SIZE=29;
class IndepHTable
{
public:
IndepHTable(); //constructor - create empty table
~IndepHTable(); //destructor
void put(string word, string def);
List get(string word);
void print();
private:
struct
{
string word;
List defList;
} dictionary[TABLE_SIZE];
};
#endif
************************************************************************************************************
and the class file is this
//IndepHTable.cpp
#include "IndepHTable.h"
#include "List.h"
#include <string>
#include <iostream>
using namespace std;
indepHTable::indepHTable()
{
dictionary.word.clear();
dictionary.defList=NULL;
}
indepHTable::~indepHTable()
{
}
void indepHTable:ut(string word, string def)
{
}
List indepHTable::get(string word)
{
}
void indepHTable:rint()
{
}
********************************************************************************************************
but i get these compiler error saying
IndepHTable.cpp:8: error: `indepHTable' has not been declared
IndepHTable.cpp:9: error: ISO C++ forbids declaration of `indepHTable'
with no t
ype
IndepHTable.cpp: In function `int indepHTable()':
IndepHTable.cpp:10: error: `dictionary' undeclared (first use this
function)
IndepHTable.cpp:10: error: (Each undeclared identifier is reported
only once for
each function it appears in.)
IndepHTable.cpp: At global scope:
IndepHTable.cpp:14: error: expected constructor, destructor, or type
conversion
before '::' token
IndepHTable.cpp:14: error: expected `,' or `;' before '::' token
IndepHTable.cpp:19: error: `indepHTable' is not a class or namespace
IndepHTable.cpp:24: error: `indepHTable' is not a class or namespace
IndepHTable.cpp:29: error: `indepHTable' is not a class or namespace
out whats the problem with this coding. any help from you guys will be
greatly appreciated.
thanks
ive the header file and the class file which looks like this
//IndepHTable.h
#ifndef INDEPHTABLE_H
#define INDEPHTABLE_H
#include <string>
#include "List.h"
using namespace std;
const int TABLE_SIZE=29;
class IndepHTable
{
public:
IndepHTable(); //constructor - create empty table
~IndepHTable(); //destructor
void put(string word, string def);
List get(string word);
void print();
private:
struct
{
string word;
List defList;
} dictionary[TABLE_SIZE];
};
#endif
************************************************************************************************************
and the class file is this
//IndepHTable.cpp
#include "IndepHTable.h"
#include "List.h"
#include <string>
#include <iostream>
using namespace std;
indepHTable::indepHTable()
{
dictionary.word.clear();
dictionary.defList=NULL;
}
indepHTable::~indepHTable()
{
}
void indepHTable:ut(string word, string def)
{
}
List indepHTable::get(string word)
{
}
void indepHTable:rint()
{
}
********************************************************************************************************
but i get these compiler error saying
IndepHTable.cpp:8: error: `indepHTable' has not been declared
IndepHTable.cpp:9: error: ISO C++ forbids declaration of `indepHTable'
with no t
ype
IndepHTable.cpp: In function `int indepHTable()':
IndepHTable.cpp:10: error: `dictionary' undeclared (first use this
function)
IndepHTable.cpp:10: error: (Each undeclared identifier is reported
only once for
each function it appears in.)
IndepHTable.cpp: At global scope:
IndepHTable.cpp:14: error: expected constructor, destructor, or type
conversion
before '::' token
IndepHTable.cpp:14: error: expected `,' or `;' before '::' token
IndepHTable.cpp:19: error: `indepHTable' is not a class or namespace
IndepHTable.cpp:24: error: `indepHTable' is not a class or namespace
IndepHTable.cpp:29: error: `indepHTable' is not a class or namespace