Check out example codes for "c++ input from terminal when program is called". It will help you in understanding the concepts better.

Code Example 1

#include <iostream>
#include <string>

int main( int argc, char* argv[] )
{
    std::string my_arg;

    // First argument is always the name of your program
    std::cout << argv[0] << std::endl;

    if( argc == 2 )
    {
        // Something has been passed in
        my_arg = argv[1];
        std::cout << "Argument passed in is " << my_arg << std::endl;
    }

    return 0;
}

Code Example 2

int i;
  cout << "Please enter an integer value: ";
  cin >> i;

Code Example 3

#include <iostream>

int main(){
  std::cout << "Hello World!" << std::endl; // prints "Hello World"
}

Learn ReactJs, React Native from akashmittal.com