C++ | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 1

C++

How to print string data type?

4th Jul 2019, 3:28 PM
Aman
Aman - avatar
12 Respuestas
+ 2
My bad. Thanks
4th Jul 2019, 4:20 PM
Aman
Aman - avatar
+ 1
cout << "String"; Perfectly works
4th Jul 2019, 3:54 PM
Airree
Airree - avatar
+ 1
and this should be written between the definition of the variable and return ??
4th Jul 2019, 4:04 PM
Aman
Aman - avatar
+ 1
The definition of what variable?
4th Jul 2019, 4:04 PM
Airree
Airree - avatar
+ 1
the definition of the variable a
4th Jul 2019, 4:05 PM
Aman
Aman - avatar
+ 1
the line string a =
4th Jul 2019, 4:05 PM
Aman
Aman - avatar
+ 1
If you got a string named a, you can print it out the same way but just put a without quotation marks
4th Jul 2019, 4:07 PM
Airree
Airree - avatar
+ 1
nope, its not working.
4th Jul 2019, 4:09 PM
Aman
Aman - avatar
+ 1
Can you show it to me so I can tell what's the problem?
4th Jul 2019, 4:10 PM
Airree
Airree - avatar
+ 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
4th Jul 2019, 4:14 PM
Airree
Airree - avatar
0
Use first string header file to print the string like #include<string>
19th May 2020, 10:59 PM
Naveed
Naveed - avatar