Xcode is not a language, it's a development environment. You can use the gcc/g++ compilers directly from the command line to compile the source code. The source code lives whereever you want, and you can compile and link to build the executables using whatever compiler you want. So, on your Mac, you can install the Xcode environment (to get the Mac g++/gcc tools, code signing tools you need for signing and certification for the App Store, etc.), install Eclipse and the Android development environment (to get the java runtime environment, c/c++ support tools, JNI support tools you need to run c/c++ code under the Android java VM), and both environments can build executables using the shared source code base (some pieces, views especially, will need to be tailored to each environment, Cocoa Touch for iPhone, iPad, Touch, whatever is used on Android, etc.).