C examples for Preprocessor:Macro
Defining Function-like Macros
#include <stdio.h> #define ABS(a) (a) < 0 ? - (a) : (a) int main(void) { printf("abs of -1 and 1: %d %d", ABS(-1), ABS(1)); return 0;//from w ww. ja v a 2 s. com }