error: Click Here

snippet from main.cpp:

std::ifstream inFile;
inFile.open ("in.txt");
TextQuery(inFile);

inFile.close();

snippet from TextQuery.cpp:

TextQuery::TextQuery(std::ifstream &in)
{
    std::size_t countLine = 0;
    std::set<std::size_t> bucket;
    std::string line;

    while (in >> line) {
        m_wordStore.push_back(line);

        ++countLine;
        bucket.insert(countLine);
        m_queryMap[bucket] = m_wordStore;
    }
}

been trying to use std::cin to replace it as input feature (with appropriate type change) but i got "invalid use of qualified-name" error instead.

Recommended Answers

All 2 Replies

TextQuery(inFile);

You're not defining an object there. Try this instead:

TextQuery tq(inFile);
commented: sorry for creating bad question, this whole hours of thinking where is the fault is a lie :( +2

wow, facepalm for myself

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.