Wednesday, March 04, 2020

CPP: Basic usage of std::cin for getting input from stdin

CPP: Basic usage of std::cin for getting input from stdin

Basic usage of getting data from standard input (keyboard normally) using std::cin.
#include<iostream>
#include<string>
int main()
{
std::string name;
std::cout << "Please enter your name : ";
std::cin >> name;
std::cout << "Hello " << name << std::endl;
return 0;
}
view raw getinput.cpp hosted with ❤ by GitHub


To build:
$: clang++ getinput.cpp

Run it:
$: ./a.out

No comments:

Configuring TUN/TAP virtual network interface for use with QEMU on Xubuntu 24.04

Configuring TUN/TAP virtual network interface for use with QEMU on Xubuntu 24.04 I am planning to run qemu-system-ppc to play around QEMU ...