Skip to content

Instantly share code, notes, and snippets.

@marksands
Created September 22, 2009 04:47
Show Gist options
  • Save marksands/190821 to your computer and use it in GitHub Desktop.
Save marksands/190821 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <string>
inline std::istream& operator >>(std::ostream& os, std::string &arg) { return (std::cin >> arg); }
inline std::ostream& operator <<(std::istream& is, std::ostream& (*_T)(std::ostream&)){ return (std::cout << _T); }
int main()
{
std::string name;
std::cout << "Name? " >> name << std::endl;
std::cout << "Hello, " << name << std::endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment