c++ reading string

C++
#include <iostream>
#include <string>
string str;
getline(cin, str);
//str contains line
Source

Also in C++: