Created
August 7, 2019 23:19
-
-
Save parzibyte/31570f7c953b412773240464eef08d45 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 <stdio.h> | |
int main(int argc, char const *argv[]) | |
{ | |
int arreglo[] = {1, 5, 20, 5, 15}; | |
// Memoria ocupada por todo el arreglo | |
int tamanioDelArreglo = sizeof(arreglo); | |
// Memoria ocupada por su primer elemento | |
int tamanioDeLaPrimeraVariableDelArreglo = sizeof(arreglo[0]); | |
// División simple | |
int longitud = tamanioDelArreglo / tamanioDeLaPrimeraVariableDelArreglo; | |
printf( "El arreglo ocupa %d bytes.\n" | |
"La primer variable ocupa %d bytes.\n" | |
"Entonces la longitud es: %d", | |
tamanioDelArreglo, tamanioDeLaPrimeraVariableDelArreglo, longitud); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment