Lab 08 - C Preprocessor
Exercise 5
C Preprocessing
Macro
#include "cs1010.h"
#define SQUARE(x) x * x
int main() {
// Will output 25
cs1010_println_long(SQUARE(5));
// Will output 16.0000
cs1010_println_double(SQUARE(4.0));
return 0;
}Generic Types
Pitfall
Bonus Info
Searching and Sorting
Binary Search
Comparison-Based Sort
Bubble Sort
Insertion Sort
Selection Sort
Counting Sort
Exercise 6
Last updated