+ 2

why this doesnt work?

string a[5] = {"aa","bb","cc","dd","ee"}; cout << a[1];

7th Dec 2018, 8:19 PM
Hayko
Hayko - avatar
4 Respuestas
+ 8
You need the input and output stream (iostream), the standard namespace library and that code needs to be in the main function and don't forget to return 0; https://code.sololearn.com/cwZ2cpfLRyAK/?ref=app
7th Dec 2018, 8:23 PM
Koketso Dithipe
Koketso Dithipe - avatar
+ 5
Weird 🤔 Are you running that code on SoloLearn? which error are you receiving?
7th Dec 2018, 8:32 PM
Koketso Dithipe
Koketso Dithipe - avatar
+ 1
thanks, i wrote it with all of that bit it doesnt work
7th Dec 2018, 8:31 PM
Hayko
Hayko - avatar
0
oh that worked i forgot about #include <string. h>
7th Dec 2018, 8:37 PM
Hayko
Hayko - avatar