gccで遊んでたのですが、以下のソースで
/tmp/cclObBZ1.o: In function `main':
/tmp/cclObBZ1.o(.text+0x20): the `gets' function is dangerous and should not be used.
と怒られました。何が原因ですか?
#include<stdio.h>
void cpt(char *str);
int main(void)
{
char ms[50];
printf("暗号化プログラム\n文字?:");
gets(ms);
cpt(ms);
printf("暗号化\n\t%s\n",ms);
return 0;
}
void cpt(char *str)
{
while(*str!='\0'){
*str=(*str+3);
str++;
}
}