Compiling C++ example program with Xcode on mac

I found them on the forums here

[Nooby Question: C++ Code Examples)

I assume they have are in working order, but that may be part of my problem. If I’ve downloaded these and they don’t work right is there any sample programs you could point me to that do work so that I can get my compiler working properly?