Skip to main content

Practice · 2 of 2

Optional result via pointer

CHALLENGE
Difficulty: intermediate+25 XP

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.

Back to lesson: Practice: Pointers and the null contract