This is a .h file for a slightly larger program where the program counts the number of uses of the words in a text file. The compiler keeps telling me that the 'string' doesn't name a type but it does have a type named word?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#ifndef CONCORDANCE_H
#define CONCORDANCE_H
#include <iostream>
#include <string>
struct Entry {
string word;
int frequency;
};
void add(Entry concordance[], int &size, const string word);
int lookup(const Entry concordance[], int size, const string word);
#endif
the errors are:
lines 8 and 12 and 13: error: 'string' doesn't name a type
also, lines 12 and 13: error: ISO c++ forbids declaration of 'word' with no type [-fpermissive]