Skip to content

Instantly share code, notes, and snippets.

@LebedevRI
Created September 14, 2016 12:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LebedevRI/225aee1a6ab5666c3d7c4c717d6be7c6 to your computer and use it in GitHub Desktop.
Save LebedevRI/225aee1a6ab5666c3d7c4c717d6be7c6 to your computer and use it in GitHub Desktop.
#include <memory>
#include <iostream>
int main(int argc, const char* argv[])
{
std::unique_ptr<float> buf(new float);
std::cin >> (*(buf.get()));
std::cout << buf.get() << std::endl;
std::cout << (*(buf.get())) << std::endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment