Created
March 14, 2014 06:24
-
-
Save Congee/9542967 to your computer and use it in GitHub Desktop.
Dangerous function gets() in C89, c99's <stdio.h>
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(void) { | |
char a[] = "ABCD"; | |
char b[] = "BCDE"; | |
char c[] = "CDEF"; | |
puts(a); | |
puts(b); | |
puts(c); | |
puts("Enter some characters"); | |
gets(b); | |
puts(a); | |
puts(b); | |
puts(c); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment