OK so if you really want here's the GETS macro to behave like gets but in a somewhat safe way:
Usage:Code:#define GETS(buf) do { \ _Static_assert(sizeof buf > sizeof(void*), "GETS(buf): character array required"); \ fgets(buf, sizeof(buf), stdin); \ if (buf[strlen(buf)-1] == '\n') buf[strlen(buf)-1] = '\0'; \ } while(0)
Code:printf("type some foo: "); char line[20]; GETS(line); printf("your foo was: %s\n", line);