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

XheartcoreboyX

macrumors 6502a
Original poster
Jul 3, 2007
753
0
So, i need to write simple c++ programs in Eclipse for a c++ college's course, i have downloaded it, but don't understand how to write in c++..

Libraries i need are iostream.h and math.h

and is there anything i have to keep in mind when writing the program? do i have to write using std ?

thanks!
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
Do you have to do it in eclipse? Is that class requirement?

If not, I would recommend, if the projects in the course are pretty small, to just use a text editor (There are a number of programmer's text editors available, both graphical and commandline), g++, and gdb. Learning that will serve you well in understanding what an IDE is doing under the hood.

At least eclipse is cross-platform, though I didn't download the ultra version that covers all of the different languages, etc., only Java. As such, I can't give specific instructions, but this thread:
http://ubuntuforums.org/archive/index.php/t-564333.html

links to this:
http://wiki.eclipse.org/CDT/User/FA...ct_--_.22Hello_World_on_a_Windows_Platform.22

Which walks you through creating a project. A managed make project will abstract the whole build process from you, which is either good or bad depending on whether or not you actually want to know how things work.

-Lee
 

foidulus

macrumors 6502a
Jan 15, 2007
904
1
I second not doing it in Eclipse

if you really need an IDE, use XCode, comes with every mac and you can download the most up to date version from Apple's website.
 

wizard

macrumors 68040
May 29, 2003
3,854
571
More information would be helpful.

The title says it all.

First; if you are programming in C++ what is with the *.h files?

Second; an intro to computer science course should have set you up to understand the building of a program.

Third; While I don't see Eclipse as being that much worst than XCode i do agree with the idea that it really pays in the long run to learn to program with a simple text editor and build a program from the command line. Back to Eclipse in many ways it is a better system than XCode, XCode is very easy to get into crash-a-matic mode. Of course updating Eclipse can do that for you two.

Fourth; we are assuming you are programming on a Mac, but it would really help if you spelt it out. Frankly, your post leaves people with the impression that you haven't even tried as there is no usable detail at all in the text.

Fifth; everybody has already mentioned that Mac OS comes with XCode and the associated development tools.

Finally as far as what to keep in mind when writing the program? Well you might want to consider why you are in the class in the first place.

Dave
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.