how do declare 100 strings using a for loop for storing 100 different names?
How do declare 100 strings using a for loop for storing 100 different names?
Just use string s[100] , now it’s an array of strings in which each index can store a string or name as you mentioned. Also if you want to store their last name then use getline else use simple cin if it’s only for first name.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.