0

How to use a string input(cin) to use a value from array?

If the user types in "IT" I want to print the value of arr[2][3] , then how can I do it? They should be different outputs for different inputs.

20th Oct 2020, 7:08 AM
Uttaran Das
Uttaran Das - avatar
3 Antworten
+ 2
Strings have a length all you need to do is loop through the string and add the position to the array.
20th Oct 2020, 8:17 AM
D_Stark
D_Stark - avatar
0
Your question is not clear. Please edit and provide more description.
20th Oct 2020, 7:16 AM
🇮🇳Omkar🕉
🇮🇳Omkar🕉 - avatar