I'm trying to understand what is the role of the do...while loop in this macro.
#define err_msg(msg) \
do { \
perror(msg); \
exit(1); \
} while (0)
Could you help me figure it out?
I'm trying to understand what is the role of the do...while loop in this macro.
#define err_msg(msg) \
do { \
perror(msg); \
exit(1); \
} while (0)
Could you help me figure it out?