Search notes:

C++ Standard Library: std::cin / std::cout - access standard in and standard out

std::cin is an instantiated object of the class istream.
#include <iostream>
#include <string>

int main () {

  int         times;
  std::string what;

  std::cout << "How many times: ";
  std::cin  >> times;
  std::cout << "which string: ";
  std::cin  >> what;

  for (int i=0; i<times; i++)
    std::cout << i << ": " << what << std::endl;

}
Github repository about-cpp-standard-library, path: /iostream/cin-cout.cpp

See also

C++ Standard Library

Index