+ 3

[Solve]When should we use string header ?

#include <string> . At what time shall we use this couze we already have the io one.

27th Aug 2018, 12:50 PM
Muhamad Fathi Zuhaili
Muhamad Fathi Zuhaili - avatar
4 Antworten
+ 3
Zack The Gamer mostly iostream included string header... but don't be dependent on it.. one should explicitly include string header when you are making use of string header functions... explicit inclusion of string header improve performance compared to without including string header
27th Aug 2018, 1:13 PM
Ketan Lalcheta
Ketan Lalcheta - avatar
+ 3
is it like iostream dont support string ? or anything else?
27th Aug 2018, 12:54 PM
Muhamad Fathi Zuhaili
Muhamad Fathi Zuhaili - avatar
+ 2
string is not used for io. It is used to perform operations on strings (duh). String = wrapper for array of characters with additional methods.
27th Aug 2018, 12:52 PM
Jakub Stasiak
Jakub Stasiak - avatar
+ 1
it does support. But when you don't need to output anything on screen you won't need iostream, hence to use strings you'd have to include string
27th Aug 2018, 12:55 PM
Jakub Stasiak
Jakub Stasiak - avatar