Type-independent Code
The preprocessor is commonly used to define algorithms independent of their type
#define ARRAY_MAX(array, size) {\
int i; \
max = array[0]; \
for (i = 1; i < size; i++) \
if (array[i] > max) max = array[i]; }
Previous slide
Next slide
Back to first slide
View graphic version