Question regarding library functions/macros
Hi everyone, I am currently learning C using KNKing C prrogramming a modern approach.
I am currently learning about the functions in the stdio.h library. There are some parts where it talks about how some functions are usually implemented as a macro while others are implemented only as a function?
E.g. this part about input functions fgetc, getc, getchar and ungetc.
"The relationship between getc and fgetc is similar to that between putc and fputc. getc is usually implemented as a macro (as well as a function) while fgetc is implemented only as a function. getchar is normally a macro as well:
#define getchar() getc(stdin) "
I have some questions: What does it mean by functions are implemented as macros while sometimes implemented as functions?
also how can getchar, which is a function in the stdlib library, be define as a macro? Thank you all.