Created
August 6, 2019 05:55
-
-
Save parzibyte/b9e8b72d2b6900bab62c88514b53117f 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
/* | |
Trabajando con arreglos de cadenas en C: | |
Pasarlo como argumento a función | |
@author parzibyte | |
*/ | |
#include <stdio.h> | |
#define MAXIMA_LONGITUD_CADENA 50 | |
void imprimirArregloDeCadenas(char arreglo[][MAXIMA_LONGITUD_CADENA], int longitudDelArreglo); | |
int main(){ | |
char arreglo[][MAXIMA_LONGITUD_CADENA] = {"Arsenal", "Bautizo", "Comadreja", "Consulta", "Dinosaurio", "Zapato"}; | |
int longitudDelArreglo = sizeof(arreglo) / sizeof(arreglo[0]); | |
imprimirArregloDeCadenas(arreglo, longitudDelArreglo); | |
} | |
void imprimirArregloDeCadenas(char arreglo[][MAXIMA_LONGITUD_CADENA], int longitudDelArreglo){ | |
for(int x = 0; x < longitudDelArreglo; x++){ | |
printf("En %d el arreglo tiene el valor %s\n", x, arreglo[x]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment