I am new to C++ and have researched this everywhere and cannot seem to figure out how to compile this and have not idea why. It works in visual C++ but not Xcode. The error seem
You forgot to #include <fstream>, the header file that actually defines all your ifstream goodness. You included <iostream> twice (or at least tried to), perhaps one of those was meant to be <fstream>?