gets()
??? C ?????????(???????,???)?????
-
??
fgets()
??gets()
:fgets()
????????????????,??????????????:char buffer[256]; fgets(buffer, sizeof(buffer), stdin);
??:
fgets()
???????????,??????????? -
??
scanf()
?????: ??%s
??????????????????,??:char buffer[256]; scanf("%5s", buffer);
?????? 255 ???,?????????????
-
?????????: ????????????????,?? Microsoft Visual Studio ??
gets_s()
:char buffer[256]; gets_s(buffer, sizeof(buffer));
???,?????????? C ?????,??????????????
-
????????: ???????,??????????????????????????????,????????????(?
malloc()
?realloc()
)??????????? -
????
gets()
: ??gets()
???? C11 ????,?????????,??????????????,???????????
??????????,????? gets()
???????,???????????????