Honest question here, what,s the point of declaring a #include <string> header when a #include <iostream> header was already declared. I always thought the string declaration is already available in the iostream standard library, except I have a wrong thought.
1/7/2017 10:02:28 AM
Oluwaseun Prosper Popoola2 Answers
New AnswerC++ in its beginnings didn't know how to work with strings. Strings used to be represented as arrays of characters. So, I assume, that's the reason why string declaration is not in iostream declaration - it was added later, and needed a whole new header for itself since C++ is not "made to" work with strings.
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message