New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

Simple Programming


Post Reply New Thread Subscribe

 
Thread Tools
stedg

 
Member Since: May 08, 2007
Posts: 7
stedg is on a distinguished road

stedg is offline
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..
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
QUOTE Thanks
surfwax95

 
surfwax95's Avatar
 
Member Since: Aug 27, 2005
Location: Fayetteville, AR
Posts: 2,410
surfwax95 has much to be proud ofsurfwax95 has much to be proud ofsurfwax95 has much to be proud ofsurfwax95 has much to be proud ofsurfwax95 has much to be proud ofsurfwax95 has much to be proud ofsurfwax95 has much to be proud ofsurfwax95 has much to be proud ofsurfwax95 has much to be proud of
Mac Specs: 15" Powerbook G4 24" iMac iPhone 3Gs

surfwax95 is offline
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).

I try to Command+Shift+/ when I can.
They're - Their - There | Two - Too - To | You're - Your | MAC - Mac
I was on the M-F honor roll for October, 2006.
QUOTE Thanks
xstep

 
xstep's Avatar
 
Member Since: Jun 25, 2005
Location: On the road
Posts: 3,231
xstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to all
Mac Specs: 2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid

xstep is offline
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.
QUOTE Thanks
knightlie

 
knightlie's Avatar
 
Member Since: Mar 22, 2007
Location: UK
Posts: 1,463
knightlie is just really niceknightlie is just really niceknightlie is just really niceknightlie is just really nice
Mac Specs: Lenovo Z560 Hackintosh -:- '06 iMac -:- iPod Touch 2ndGen

knightlie is offline
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!

[URL="http://beadia.net"]Beadia[/URL - Jewelry Business Management Software]
I judge you when you use poor grammar.
QUOTE Thanks
stedg

 
Member Since: May 08, 2007
Posts: 7
stedg is on a distinguished road

stedg is offline
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
QUOTE Thanks
Kaurotu

 
Kaurotu's Avatar
 
Member Since: Apr 26, 2007
Location: Geneseo, IL
Posts: 36
Kaurotu is on a distinguished road
Mac Specs: Standard Black MacBook

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

g++ -o program name source file

then type ./executableName to run it

I need no warrant or sanction upon my being. I am the warrant and sanction. - Ayn Rand
QUOTE Thanks
stedg

 
Member Since: May 08, 2007
Posts: 7
stedg is on a distinguished road

stedg is offline
sorry but i couldnt d that
"
g++
-bash: g++: command not found
"

what can i do?
QUOTE Thanks
Kaurotu

 
Kaurotu's Avatar
 
Member Since: Apr 26, 2007
Location: Geneseo, IL
Posts: 36
Kaurotu is on a distinguished road
Mac Specs: Standard Black MacBook

Kaurotu is offline
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/.

I need no warrant or sanction upon my being. I am the warrant and sanction. - Ayn Rand
QUOTE Thanks
mbgaski

 
Member Since: May 10, 2007
Posts: 17
mbgaski is on a distinguished road

mbgaski is offline
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 .
QUOTE Thanks
knightlie

 
knightlie's Avatar
 
Member Since: Mar 22, 2007
Location: UK
Posts: 1,463
knightlie is just really niceknightlie is just really niceknightlie is just really niceknightlie is just really nice
Mac Specs: Lenovo Z560 Hackintosh -:- '06 iMac -:- iPod Touch 2ndGen

knightlie is offline
Emacs? Blimey. I'll stick to Smultron and Eclipse.

[URL="http://beadia.net"]Beadia[/URL - Jewelry Business Management Software]
I judge you when you use poor grammar.
QUOTE Thanks

Post Reply New Thread Subscribe


« applescript syntax help | Wanted: Programmer »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Simple Pie Chart Creation? Toahine OS X - Apps and Games 3 06-07-2006 06:00 AM
Programming idea: "MacTV" kaidomac Schweb's Lounge 8 02-20-2006 04:28 PM
Simple AppleScript request... 570thusaag Running Windows (or anything else) on your Mac 0 02-02-2006 12:33 PM
Robotic NQC Programming ApplejustWorks Schweb's Lounge 0 01-31-2005 06:28 AM
Simple finder hacking trip OS X - Operating System 0 03-07-2004 10:16 AM

All times are GMT -4. The time now is 07:53 PM.

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

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?