Ok, something is wrong with this. I've stared at this for about 20 minutes and I can't fix it! This is either an incredibly simple mistake or something is horribly wrong with MS VC++ .NET I've never used .net before but my professor is making us use it, so I'm struggling to get through this.
Compiler gives this lovely error : 'getString' : is not a member of 'TreeTokenReader'
Here are the important parts of main.cpp
#include <iostream>
#include "ParseInput.h"
#include "TreeSequence.h"
#include <string.h>
using namespace std;
int main(int argc, char* argv[])
{
TreeTokenReader input;
char filename[256];
cout << "Please enter the filename you wish to scan" << endl;
cin >> filename;
if( input.openFile(filename) != 1 ) {
return 1; // file doesn't exist, don't go further
}
input.getString();
return 0;
}
As you can see, getString() is at the bottom part.
Here's the .h :
class TreeTokenReader {
protected:
char fileName[256];
ifstream *inpt;
public:
enum return_type { MYEOF = 0, LEFT_PAREN, RIGHT_PAREN, INTEGER, UNKNOWN }; // possible tokens
int value; // for integer token the value of the integer
TreeTokenReader();
~TreeTokenReader();
void getString();
....blah...blah
};
Here's the .cpp
// called only when the file exists
void TreeTokenReader::getString() {
....blah...blah....
}
What the hell is wrong with this?! It works for all of the other functions! I don't like you Visual C++!! I want my vi back!
-silver
Compiler gives this lovely error : 'getString' : is not a member of 'TreeTokenReader'
Here are the important parts of main.cpp
#include <iostream>
#include "ParseInput.h"
#include "TreeSequence.h"
#include <string.h>
using namespace std;
int main(int argc, char* argv[])
{
TreeTokenReader input;
char filename[256];
cout << "Please enter the filename you wish to scan" << endl;
cin >> filename;
if( input.openFile(filename) != 1 ) {
return 1; // file doesn't exist, don't go further
}
input.getString();
return 0;
}
As you can see, getString() is at the bottom part.
Here's the .h :
class TreeTokenReader {
protected:
char fileName[256];
ifstream *inpt;
public:
enum return_type { MYEOF = 0, LEFT_PAREN, RIGHT_PAREN, INTEGER, UNKNOWN }; // possible tokens
int value; // for integer token the value of the integer
TreeTokenReader();
~TreeTokenReader();
void getString();
....blah...blah
};
Here's the .cpp
// called only when the file exists
void TreeTokenReader::getString() {
....blah...blah....
}
What the hell is wrong with this?! It works for all of the other functions! I don't like you Visual C++!! I want my vi back!
-silver