Hey, I am getting these compiler errors:
Code:
15 bst.h variable or field `processInput' declared void
15 bst.h expected `;' before '(' token
14 bst.cpp no `void BST::processInput(std::ifstream&)' member function declared in class `BST'
My code is:
bst.h
Code:
#include <string>
#include <fstream>
#ifndef BST_H
#define BST_H
class BST
{
public:
//BST(void);
void processInput(ifstream & inSource);
};
#endif
bst.cpp
Code:
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <string>
#include "bst.h"
using namespace std;
void BST::processInput(ifstream & inSource)
{
string line;
while(getline(inSource, line) != NULL)
cout << line << "\n";
}
And the method is called by:
Code:
// error checking removed for length
fileName = argv[1];
fileStream.open(fileName);
myBST.processInput(fileStream);
Any help with the error?