+ 3

How to add string in array?

My code: #include <iostream> #imclude <string> int main() { string classes[2][2]= {{"name","name"},{"name2","name3"}; cout <<classes[1][1] << endl; return 0; }

15th Jun 2019, 3:36 PM
Aman Kumar
Aman Kumar - avatar
7 Antworten
+ 4
So sorry for giving trouble.And thanks alot.
16th Jun 2019, 3:42 AM
Aman Kumar
Aman Kumar - avatar
+ 4
🙂🙂🤘
16th Jun 2019, 3:45 AM
Aman Kumar
Aman Kumar - avatar
+ 2
But it is showing error that there is no global '[]' in string
15th Jun 2019, 4:17 PM
Aman Kumar
Aman Kumar - avatar
+ 2
I have written #include <string> only not #imclude <string>
15th Jun 2019, 4:37 PM
Aman Kumar
Aman Kumar - avatar
+ 2
No it is not
15th Jun 2019, 11:51 PM
Aman Kumar
Aman Kumar - avatar
+ 2
Sorry but when I edited it then also it is showing error.
16th Jun 2019, 3:29 AM
Aman Kumar
Aman Kumar - avatar
+ 2
Run it and see it then also shows error. https://code.sololearn.com/cXb0I1lDKTqK/?ref=app
16th Jun 2019, 3:36 AM
Aman Kumar
Aman Kumar - avatar