Created
June 16, 2013 02:42
-
-
Save alculquicondor/5790546 to your computer and use it in GitHub Desktop.
Ejemplo básico de manejo de memoria en C++
This file contains hidden or 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
Clase { | |
}; | |
int main() { | |
int *arreglo = new int[10]; | |
delete []arreglo; | |
Clase *objeto = new Clase; | |
delete objeto; | |
Clase **arreglo_objetos = new Clase*[12]; | |
for (int i = 0; i < 12; i++) | |
arreglo_objetos[i] = new Clase; | |
for (int i = 0; i < 12; i++) | |
delete arreglo_objetos[i]; | |
delete []arreglo_objetos; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment