Mac Forums

Mac Forums (
-   OS X - Development and Darwin (
-   -   Simple Programming (

stedg 05-08-2007 08:57 AM

Simple Programming
Hey guys...
ok this is very simple, though i've been searching hard for this kind of app
i'm having some basic C++ programming classes and i use the bloodshed dev-C++ for windows there...
i wouldnt be here if i didnt love mac and had one.. :D
so i wanted to know a real basic app for mac, i tried xcode and eclipse but there were too tough for me :\
I'm justing doing some basic programs as fatorial, percentage, learning just if..else ; continue; break; printf; scanf; while...

Could you help me please?
Thanks from now on..

See you

surfwax95 05-08-2007 09:10 AM

I really don't know much about C, but most Macs have a C compiler installed (gcc, right?) that you can access from the Terminal (Apps/Utilities).

xstep 05-09-2007 04:04 AM

Since you have installed XCode, you have the tools you need for the simple stuff and don't have to use XCode. The C++ and C compiler can be used via the command line. For a C program I'd type something like 'cc test.c' in the folder that file exists in. I'm not sure if the C++ syntax is different since I've never done that. Type 'man c++' at the Terminal command line.

As far as editing your files, you can use TextEdit. Just fix the preferences so it creates plain text files and doesn't add .txt to the file.

knightlie 05-09-2007 04:07 AM

I think the C++ compiler is caller cpp. Also, try the Smultron text editor - it'll do syntax highlighting. I use Eclipse for Java programming, and you're right - it's not exactly beginner-friendly!

stedg 05-09-2007 09:47 PM

Hey knightlie that helped me a lot...
a tried smultron and its very simple to use...
thanks a lot

though now im having another problem....
how can i make my program work?
like.. doing the stuffs that i set?
in my classes its runs the program in the ms-dos prompt
can i make my program at home work on something like it? maybe the terminal?


Kaurotu 05-10-2007 09:41 PM

To access the GCC C++ compiler from the terminal you just type:

g++ -o program name source file

then type ./executableName to run it

stedg 05-11-2007 06:04 PM

sorry but i couldnt d that
-bash: g++: command not found

what can i do?

Kaurotu 05-11-2007 08:24 PM

Make sure you have the GCC installed. If you're programming on your Mac, it comes with Xcode Tools. If you're programming on Windows or Linux, you can get it from

mbgaski 05-22-2007 11:40 AM

I'm new to Macs myself (I use Borland C++ Builder on Windows and a Glade/Emacs/gcc on Linux), but from my understanding, you can get Emacs working just fine (along with most other Unix apps) using the Mac X11 server. If you want a good programming text editor, that's a good place to start. The syntax highlighting and auto-ident features I really like. Far different than the annoying type auto-formatting that Microsoft does, with Emacs, if it formats something differently than I expected, I know I made and error in my code that I need to fix ;).

knightlie 05-22-2007 04:16 PM

Emacs? Blimey. I'll stick to Smultron and Eclipse. ;)

All times are GMT -4. The time now is 05:49 PM.

Powered by vBulletin
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.