glassJAw Posted March 9, 2007 Share Posted March 9, 2007 I have to program basic programs in C++ for my class. I use to use Quincy which would run programs in the ms dos. I need something that would run the same code and run it in the terminal. How do I do this in xCode or is there a simpler program??? I'll be running Windows in Parallels probably just to be consistent. Link to comment Share on other sites More sharing options...
Kowaru Posted March 9, 2007 Share Posted March 9, 2007 When you create a project in xCode, you can choose C++ Tool under the Command Line Utility heading. Link to comment Share on other sites More sharing options...
glassJAw Posted March 9, 2007 Author Share Posted March 9, 2007 Thank you.. one more thing.. this is the code it shows at start.. #include <iostream> int main (int argc, char * const argv[]) { // insert code here... std::cout << "Hello, World!\n"; return 0; } I am use to doing it this way.. #include <iostream> int main () { // insert code here... cout << "Hello, World!\n"; return 0; } How do I make it so I can program the 2nd way? Thanks! Link to comment Share on other sites More sharing options...
erbic Posted March 9, 2007 Share Posted March 9, 2007 (edited) That's been my problem too. I've been needing to re-learn C++, and I want a Mac-based compiler that will let me program the "old" way. EDIT: I've discovered that this is the same with a lot of UNIX-based compilers. It seems that many Windows compilers assume the standard library, while it must be declared in UNIX. Sticking a namespace declaration under the #include tags can eliminate the problems you and I described. #include <iostream> using namespace std; int main() { cout << "Hello, World!\n"; return 0; } Simply declaring the namespace will cause the above code to compile without issues. Edited March 9, 2007 by ErBiC Link to comment Share on other sites More sharing options...
Fiendskull9 Posted March 14, 2007 Share Posted March 14, 2007 you can also use vim and gcc.... no need to open xcode for cli apps :mellow: -clay Link to comment Share on other sites More sharing options...
asap18 Posted March 14, 2007 Share Posted March 14, 2007 xcode uses the gcc compiler and if you have it can use the Intel CPP compiler(icc), it is just an ide to the languages. i love the build & go feature, saves alot of clicks. Link to comment Share on other sites More sharing options...
Recommended Posts