Created
August 1, 2019 15:29
-
-
Save parzibyte/ad21e20d7927fa4a42c955ded02b1027 to your computer and use it in GitHub Desktop.
Leer variable con fgets y evitar desbordamientos: https://parzibyte.me/blog/2018/11/18/fgets-vs-scanf-en-c/
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> | |
#define LONGITUD 20 | |
int main(){ | |
char nombre[LONGITUD]; | |
printf("Dime tu nombre: "); | |
fgets(nombre, LONGITUD, stdin); | |
printf("Hola, %s", nombre); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment