Created
December 29, 2012 17:33
-
-
Save ElemarJR/4408224 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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