In message <e85e2$47b58e93$89382996$> , Ko van der
Sloot <> writes
>Keith Halligan wrote:
>> On Feb 15, 11:30 am, C__chp <nheilig...@chello.nl> wrote:
>>> the compiler is marking an error at lines
>>>
>>> vector<string> v;
>>> and
>>> string line
>>>
>>> ===============================
>>>
>>> implementation cpp file: adfile.cpp
>>> #include "adfile.h"
>>> #include <string>
>>> #include <iostream>
>>> #include <fstream>
>>> #include <vector>
>>> using namespace std;
>>>
>>
>> You aren't including the headers for the stl vector and string in the
>> class's header, so it doesn't understand what a vector<string> is
>
>And the solution is .....
>
>move #include "adfile.h" 5 lines down, after #include <vector>
No, it's to put both "#include <vector>" and "#include <string>"
*inside* adfile.h, and to prefix all occurrences of "vector" and
"string" in that file with std:: .
Since adfile.h refers to both "vector" and "string" it's only courtesy
to the reader (and the compiler

to explain what they are supposed to
mean. Relying on the user to include headers in a particular order is
not a robust solution.
--
Richard Herring