+ 1
I have a problem regarding displaying name of the user
It gets an error on the cout I wanted to accept only 5 names only from the user input and display it. https://code.sololearn.com/c3sG9f4tKw2s/?ref=app
5 Respostas
+ 5
shlee_
Print like this
for(int i=0; i<5; i++){
if (arr[i] != "")
cout<<"\nHere are the names: "<< arr[i];
}
+ 4
shlee_
name++; should be outside the else part to avoid Execution timeout.
And you should print arr instead of NameEntered, this will print only last entered name.
+ 2
line 51:
you have only 1 of "<", try to use 2 of them, like earlier
+ 2
Thank you A͢J
0
A͢J still shows only last name entered