Simple Programming

Joined
May 8, 2007
Messages
7
Reaction score
0
Points
1
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
 
Joined
Aug 27, 2005
Messages
2,406
Reaction score
210
Points
63
Location
Fayetteville, AR
Your Mac's Specs
15" Powerbook G4 • 24" iMac • iPhone 3Gs
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).
 
Joined
Jun 25, 2005
Messages
3,231
Reaction score
112
Points
63
Location
On the road
Your Mac's Specs
2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
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.
 
Joined
Mar 22, 2007
Messages
1,463
Reaction score
67
Points
48
Location
UK
Your Mac's Specs
Lenovo Z560 Hackintosh -:- '06 iMac -:- iPod Touch 2ndGen
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!
 
OP
S
Joined
May 8, 2007
Messages
7
Reaction score
0
Points
1
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?

thaanks
 
Joined
Apr 26, 2007
Messages
36
Reaction score
1
Points
8
Location
Geneseo, IL
Your Mac's Specs
Standard Black MacBook
To access the GCC C++ compiler from the terminal you just type:

g++ -o program name source file

then type ./executableName to run it
 
OP
S
Joined
May 8, 2007
Messages
7
Reaction score
0
Points
1
sorry but i couldnt d that
"
g++
-bash: g++: command not found
"

what can i do?
 
Joined
Apr 26, 2007
Messages
36
Reaction score
1
Points
8
Location
Geneseo, IL
Your Mac's Specs
Standard Black MacBook
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 http://gcc.gnu.org/.
 
Joined
May 10, 2007
Messages
17
Reaction score
0
Points
1
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 ;).
 
Joined
Mar 22, 2007
Messages
1,463
Reaction score
67
Points
48
Location
UK
Your Mac's Specs
Lenovo Z560 Hackintosh -:- '06 iMac -:- iPod Touch 2ndGen
Emacs? Blimey. I'll stick to Smultron and Eclipse. ;)
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top