0
When should we include the headers.
#include<string> and #include<sstream> or when is the header-string and sstream required.
2 Réponses
+ 5
Keto Z answer is spot on.
You include the headers when you need some functionalilty from them.
we include iostream for cin cout endl and stuff. without it we couldnt use these and would have to write the code for this functionality ourselves.
edit:
for those specific headers you would need them for working with strings and stringstreams.
+ 3
In a program, you pull from the libraries you include in your programs. So, you could include string.h to use string data types. It's also useful to create your own headers to include in your programs.