I have written a code-snippet which makes use of headers (dohhh). Anyway, I have a class in source.h which has a function that uses sstream. So I thought I had to #include <sstream> to my header file, is this correct? And when I call the function in source.cpp should I #include <sstream> aswell? Thanks in advance luq
I'm going to assume you meant <sstream>, but anyway.
So, if you make use of sstream in the header, you just include it in the header.
Then, you include the header in the source.cpp file.
When you include a file, all of its inclusions are also included. So it kind of links together in a web.
Thus, you only need the inclusion in the header file.