Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

thestaton

macrumors 6502
Original poster
Jan 19, 2006
478
0
This semester I just finished up intro to programming and we focused on theory and used a little bit of QBasic in windows to learn how to program using top down.

Next semester I am starting out with the beginning C++ class, so over the Christmas break I wanted to get a head start so I went ahead and purchased the book and am going to attempt to teach myself.

I remember back when I used FreeBSD I used to code using the equivalent of the terminal, but since I'm using leopard there might be other options.

I installed xcode off the dvd, but I'm not to sure about it at the moment, I much preferred the different colors I could use in the terminal when writing code.

So if someone could please help me with what I need to do, to get started I would greatly appreciate it.

I'm looking for help with:

Getting started preferably using terminal. But if xcode is better I've not no problem using that.

Compiling either with terminal or xcode.

What file do I need to edit if I use terminal to change the colors to my liking?

Thanks again,
 

iSavant

macrumors regular
Mar 31, 2007
147
0
Colorado
xcode

make a small commitment
to spend the little bit of time

that would be a worthwhile investment

good luck in your studies
 

steelphantom

macrumors 6502a
Oct 15, 2005
555
1
Well, if you're just writing basic C++ programs, you can use a simple text editor (I like Smultron) and the Terminal with no problems. Write your program in your text editor of choice, and to compile, follow these steps in the Terminal:

1. To get to your program's directory, type in the following: "cd directory/of/your/program" without quotes. Replace directory/of/your/program with whatever the directory is to your program. For example, "cd Documents/Programming/C++".

2. To compile your program, type the following, again without quotes: "g++ myprogram -o myprogram.cpp" where myprogram is the name of your program, of course! All C++ source files should be saved with .cpp at the end. This will create an executable file in the same directory as your .cpp file. You can click on it and it will run in the Terminal.

Hope this wasn't too confusing, and will help get you started! :)
 

ledd

macrumors newbie
Dec 26, 2006
23
0
Depending on the level of education your currently at...
Most college institutions will instruct C++ via Linux/Unix with editors like Vi and Emacs. (or in my opinion should) I would suggest starting with emacs and g++ and gcc from the terminal. Full editors like xCode, CodeWarrior, and .Net are numerous and not one is necessarily most popular. Its a safe bet (unless you are on windows) you will always have the same good old emacs and vi. Also, its also good to become familiar with the unix terminal and the many tools it has to offer. Not to mention once you have c++ down using whatever editor you have available will be simple.

Another plus to for learning c++ and using emacs/vi is that you don't (at least with a default emacs/vi) have auto complete which is very helpful but at the same time having to remember string functions etc... gets them locked in your brain.

Just as the previous post says you can make your first program very easily with out learning xCode as well.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.