+ 1
What is the use of including string library because we can use its function without including it ?
For example ; #include <iostream > #include <string> using namespace std; int main (){ string a = 'sudip'; cout <<a.length (); return 0; } NEXT PROGRAM: #include <iostream > using namespace std; int main (){ string a = 'sudip'; cout <<a.length (); return 0; } Both programs gives output without any error.
2 Respostas
+ 4
I asked the same question before
https://www.sololearn.com/post/69831/?ref=app
+ 1
The iostream library already has the string library included. It's not necessary to include <string> when <iostream> is in your code.