Install the Unix tools and you will get a command line compiler (gcc). Install Xcode for a graphical compiler (and a whole lot more).
However, since OSX sits on top of Unix, the base install may already have gcc, g++ and c++ ready to go. A Unix box almost has to have a live c compiler just to get updates and new apps installed, but since I always install the Unix tools on any new Mac I get, I am not sure. However, an easy way to find out is to open a terminal session and enter "which gcc", "which g++" and which "c++". If the response(s) is a path, then you have the queried compiler installed.
Konan