Created
January 21, 2016 18:31
-
-
Save jmramirezpro/b356e3fc54cd034d8a10 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
/* | |
* Cadena2.c | |
* Solución a los ejercicios del podcast Codigo Fuente - Programa 18 | |
* Programa que hace operaciones erroneas con strings por la declaración de tamaño | |
* insuficiente de los mismos | |
* Creado el 13 de ene. de 2016 | |
* Author: jmramirez | |
*/ | |
#include <stdio.h> | |
#include <string.h> | |
int main(void) | |
{ | |
char cadena [10]; | |
int i = 3; | |
strcpy (cadena, "Esto es un error"); | |
printf("Cadena es: %s\n", cadena); | |
for (i=0; i< strlen(cadena); i++){ | |
printf ("El elemento %d de cadena es %c\n", i, cadena[i]); | |
} | |
return(0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment