0

Why not show output of this code.someone explain it.Thanks

#include <string> using namespace std; int main() { string a = "I am learning C++"; return 0; }

25th Aug 2017, 10:18 AM
Sultan Ali
Sultan Ali - avatar
3 Respuestas
+ 13
Because you never printed the string. #include <iostream> #include <string> using namespace std; int main() { string a = "I am learning C++"; cout << a; return 0; }
25th Aug 2017, 10:25 AM
Hatsy Rei
Hatsy Rei - avatar
+ 2
because you initialize a string variable but you don't print that... you need to include iostream (#include<iostream>) and print with cout ostream ... inside your main () cout<<a;
25th Aug 2017, 10:27 AM
Michele Virgilio
Michele Virgilio - avatar
0
Thanks for help. now I understand. Thanks
25th Aug 2017, 10:26 AM
Sultan Ali
Sultan Ali - avatar