Skip to content

Instantly share code, notes, and snippets.

@ElemarJR
Created December 29, 2012 17:33
Show Gist options
  • Save ElemarJR/4408224 to your computer and use it in GitHub Desktop.
Save ElemarJR/4408224 to your computer and use it in GitHub Desktop.
#include <string>
#include <iostream>
class Envelope
{
private:
std::string _value;
public:
Envelope(const std::string value):
_value(value)
{
std::cout
<< "Constructing Envelope to "
<< _value
<< std::endl;
}
~Envelope()
{
std::cout
<< "Destructing Envelope to "
<< _value
<< std::endl;
}
std::string getValue() const
{
return _value;
}
};
int main()
{
Envelope* e = new Envelope("Elemar Jr");
std::cout << e->getValue() << std::endl;
delete e;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment