Given the following two statements to use fgets and strip the newline:
puts("Enter the name.");
fgets(temp.name, 40, stdin);
temp.name[strcspn(temp.name, "\n")] = 0;
Is the following macro sufficient to take the place of this?
#define FGETS(str, len) fgets(str, len, stdin); str[strcspn(str, "\n")] = 0
FGETS(temp.name, 40);
Are there any deficiencies or ways it can be improved?