¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita+ 1
C++
How to print string data type?
12 Respuestas
+ 2
My bad. Thanks
+ 1
cout << "String";
Perfectly works
+ 1
and this should be written between the
definition of the variable and return ??
+ 1
The definition of what variable?
+ 1
the definition of the variable a
+ 1
the line
string a =
+ 1
If you got a string named a, you can print it out the same way but just put a without quotation marks
+ 1
nope, its not working.
+ 1
Can you show it to me so I can tell what's the problem?
+ 1
You didn't tell the program anywhere you want to output it, and sadly, it can't read your mind :/
https://code.sololearn.com/cVUllOhej75V/?ref=app
0
Use first string header file to print the string like
#include<string>