#include <iostream>
#include "vervang.h"
usingnamespace std;
int main()
{
string s;
char bron, doel;
cout<<"Give up a sentence/word: ";
getline(cin, s);
cout<<"Which character has to be replaced?\n";
cin>>bron;
cout<<"By which character?\n";
cin>>doel
vervang(s, bron, doel);
}
You're #including vervang.h before you say you're using namespace std, therefore when the compiler sees the 'string' in vervang.h, it doesn't know you mean std::string.
Possible solutions (listed in order of "better" to "worse") are:
2) put 'using namespace std' before '#include "vervang.h"' in your cpp file(s)
3) put 'using std::string' or 'using namespace std;' in vervang.h. Note I mention this for completeness only. This is actually a bad idea since it destroys the namespace, and I do not recommend it!