I assume it has something to do with the #includes, but this is my first time trying to use them so I'm a little lost. I just wondered if anyone could tell immediately if there was an obvious mistake.
/** @file Translator.cpp */
#include <fstream>
#include "Translator.h"
#include <vector>
Translator(std::ifstream& fin) //error appears on this line
{
T1(fin);
T1.createTable(fin);
T2(fin);
T2.createTable(fin));
string temp;
while(!fin.eof())
{
fin >> temp;
message.push_back(temp);
}
}
Thanks for your time.
It is hard to answer this question exactly without seeing the header, but if this is a function, you need to add a return type of void
to the definition of your function:
void Translator(std::ifstream& fin) {
...
}
If this is a constructor, you need to provide its qualified name:
Translator::Translator(std::ifstream& fin) {
...
}
Without the declaration of Translator
it's a bit hard to say, but if it's meant to be a constructor, then it should be Translator::Translator(std::ifstream& fin)
. If it's meant to be a method, then it should have a return type specified, so something like void Translator(std::ifstream& fin)
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With