-3

how can i display loop character for a statement? the user input the name and computer looping it, and then it stop by a sentinel. the statement show all of the name that inputted by user.

example: NAME: gaby jessy alicia justin

jihan
  • 3
  • 3
  • 2
    1) Please provide [mcve] of your attempt. 2) Please elaborate on your problem. It's not, entirely, clear as-is. – Algirdas Preidžius Sep 21 '18 at 15:57
  • i wanna make a program using do-while to loop a character name, and show ALL of the name that i've input in the end of the program. how is it/ – jihan Sep 21 '18 at 16:18
  • "_i wanna make a program_" What's stopping you? SO is **not** code writing service. If you want to learn how to write such a program, consider learning from a [good C++ book](https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list). – Algirdas Preidžius Sep 21 '18 at 16:23
  • but i dont know how to use do-while to show all the character that i've input, so i ask here hehe – jihan Sep 21 '18 at 16:28
  • 1
    @janodoe I already gave you a suggestion. SO is **not** a tutorial service either. So, if you want to learn how to use basic features of C++, consider learning from a [C++ book](https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list). – Algirdas Preidžius Sep 21 '18 at 16:34

1 Answers1

0

Here's some starting code:

#include <iostream>
#include <string>
#include <vector>  

int main()
{
  std::vector<std::string> database;
  std::string name;
  while (std::cin >> name)
  {
    database.push_back(name);
  }
  return 0;
}

The OP needs to add code after the names are read in.

Note: I didn't add the code because I do not have clear understand of the OP's requirements.

Thomas Matthews
  • 56,849
  • 17
  • 98
  • 154