Read from console in C++
Wed 01 January 2020
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
using namespace std;
int main() {
// read 2 integers, seperated by space
int a, b;
cout << "Enter 2 integers, seperated by space: ";
cin >> a >> b;
cout << "a: " << a << ", b: " << b << endl;
// read single word c-style string.
// NB: May not contain spaces.
char season …
Category: Snippets [C++]
Read More