Created
July 9, 2011 01:13
-
-
Save TvdW/1073174 to your computer and use it in GitHub Desktop.
C++ memory object extending
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
class Sheep : Object { | |
void makeNoise(); | |
}; | |
int main() { | |
Sheep* sheep = new Sheep; // it is automatically retained once. | |
// Do stuff with the sheep | |
sheep.release(); // it is deallocated | |
return EXIT_SUCCESS; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment