c : gets() and fputs() are dangerous functions?
In the computer lab at school we wrote a program using fputs and the compiler returned an error gets is a dangerous function to use and a similar error for fputs but at home when i type in this bit of code: #include <stdio.h> main() { FILE *fp; char name[20]; fp = fopen("name.txt","w"); gets(name); fputs(name,fp); fclose(fp); } i get no errors what so ever. The one at school was similar to this one, just a bit lengthy and having more variables. I use codeblocks at home and the default gcc provided with fedora at school. Could it be a problem with the compiler? With gets you need exactly know