Skip to main content

Practice ยท 2 of 2

Optional result via pointer

Implement const int* max_of(const int* a, const int* b): return a pointer to the larger int; if both are null return nullptr; if one is null return the other's pointer.

Difficulty: intermediate

Back to lesson: Practice: Pointers and the null contract