Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Applications > C programming

C programming
Thread Tools
daniel999
Junior Member
Join Date: Jun 2003
Location: HKG / LHR
Status: Offline
Reply With Quote
Oct 8, 2003, 02:41 PM
 
Are there any software for Mac which I can write C++ or C program with?? I just started to learn C language

I saw people using Microsoft Visual Studio before and I quite like it, does it have a OSX version or is there any other programs that have a user interface similar to it? I don't like Borland C++, i think its hard to use for a newbi like me
Got a 12" Powerbook ^__^
     
CheesePuff
Professional Poster
Join Date: Jan 2002
Location: Rochester, NY
Status: Offline
Reply With Quote
Oct 8, 2003, 02:55 PM
 
Apple Developer Tools - free.
     
Earth Mk. II
Mac Elite
Join Date: Feb 2001
Location: Washington, DC
Status: Offline
Reply With Quote
Oct 8, 2003, 03:14 PM
 
I second the DevTools from Apple. They're free and good. Especially for learning.

The DevTools should come with your OS X box, or in a disk image on a Mac that ships with OS X on it. But, you might also want to consider getting a free on-line developer account at http://connect.apple.com/ for access to the latest updates and downloads for the development tools.
/Earth\ Mk\.\ I{2}/
     
kentuckyfried
Senior User
Join Date: Jan 2002
Location: Bay Area, CA
Status: Offline
Reply With Quote
Oct 8, 2003, 03:52 PM
 
all the GNU tools you might use at school are included...AWESOME stuff.


Originally posted by CheesePuff:
Apple Developer Tools - free.
Now I know, and knowing is half the battle!
     
CharlesS
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Oct 8, 2003, 05:45 PM
 
Agreed about the Apple developer tools.

However, with the release of Panther on the 24th, they will release a new version of the dev tools named Xcode that appears to be a massive overhaul. You should have a look at that when it is available.

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
asidrane
Junior Member
Join Date: Jun 2001
Status: Offline
Reply With Quote
Oct 9, 2003, 02:40 AM
 
You can always just do stuff in terminal. How advanced is your c? Vi or emacs is enough of an editor to learn basic data structures and gcc through the command line doe sa great job compiling.
     
daniel999  (op)
Junior Member
Join Date: Jun 2003
Location: HKG / LHR
Status: Offline
Reply With Quote
Oct 9, 2003, 03:28 AM
 
I have used gcc, but i think for a newbi like me, its better to use visual studio like software as i think its easier for me to understand it. does gcc got mac version??

and btw, y the developer tools is so big? it takes me more then half an hour to install yesterday and it takes up about 5xx MB of HDD space!
Got a 12" Powerbook ^__^
     
VEGAN
Senior User
Join Date: Jun 2002
Location: UK
Status: Offline
Reply With Quote
Oct 9, 2003, 05:02 AM
 
Originally posted by daniel999:
I have used gcc, but i think for a newbi like me, its better to use visual studio like software as i think its easier for me to understand it. does gcc got mac version??

and btw, y the developer tools is so big? it takes me more then half an hour to install yesterday and it takes up about 5xx MB of HDD space!
gcc is included
     
fat mac moron
Grizzled Veteran
Join Date: Sep 2002
Status: Offline
Reply With Quote
Oct 9, 2003, 08:46 AM
 
OS X is a great development platform with the tools available from Apple. Besides being able to program in C, C++, and Objective C, you also have access to Fortran, Perl, PHP, Java, Python, Lisp, Cobol, Eiffel, and Ruby, via the Fink Project. Plus digging into shell scripting and automation is a whole different animal.

Check out SubEthaEdit if you want a simple (Free) IDE that has syntax highlighting for C, C++, CSS, HTML, Java, Javascript, LaTeX, Objective-C, Pascal, Perl, PHP, Python, Ruby, SQL, and XML.
     
Earth Mk. II
Mac Elite
Join Date: Feb 2001
Location: Washington, DC
Status: Offline
Reply With Quote
Oct 9, 2003, 10:20 AM
 
Originally posted by daniel999:
I have used gcc, but i think for a newbi like me, its better to use visual studio like software as i think its easier for me to understand it. does gcc got mac version??

and btw, y the developer tools is so big? it takes me more then half an hour to install yesterday and it takes up about 5xx MB of HDD space!
Well, the Dev Tools are so big because you're installing the tools themselves, which include Interface Builder, Project Builder (which uses gcc and gdb), a bunch of debugging/optimization utilities, a bunch of unix tools (gcc and gdb as already mentioned, flex, bison, etc.), and example programs and documentation on how to use the tools and on the API's and such (don't get too excited, it's mostly technical documentation - but there is a tutorial or two).

You want to use Project Builder, and you want to create a new 'Standard Tool' project. This will set you up to use C. If you want to do C++, make a new 'C++ Tool' project.

Or you can use a line editor on the cli and run gcc that way ('gcc -o <output name> <source files>' for C, and 'g++ -o <output name> <source files>' for C++).

Each IDE is different, so PB won't be exactly like MS's suites - but I think it's close enough to what you want.

hope you're finding all this helpful.
/Earth\ Mk\.\ I{2}/
     
daniel999  (op)
Junior Member
Join Date: Jun 2003
Location: HKG / LHR
Status: Offline
Reply With Quote
Oct 9, 2003, 02:37 PM
 
Originally posted by Earth Mk. II:
Well, the Dev Tools are so big because you're installing the tools themselves, which include Interface Builder, Project Builder (which uses gcc and gdb), a bunch of debugging/optimization utilities, a bunch of unix tools (gcc and gdb as already mentioned, flex, bison, etc.), and example programs and documentation on how to use the tools and on the API's and such (don't get too excited, it's mostly technical documentation - but there is a tutorial or two).

You want to use Project Builder, and you want to create a new 'Standard Tool' project. This will set you up to use C. If you want to do C++, make a new 'C++ Tool' project.

Or you can use a line editor on the cli and run gcc that way ('gcc -o <output name> <source files>' for C, and 'g++ -o <output name> <source files>' for C++).

Each IDE is different, so PB won't be exactly like MS's suites - but I think it's close enough to what you want.

hope you're finding all this helpful.


Thanks! it helps
but what is "cli"?

theres already a "Hello World" when I start with a new project, but at the bottom line, its "return 0;". Is that the same as "return(0);" because thats what my tutor teaches me. is it different because its running on mac?

Thanks
Got a 12" Powerbook ^__^
     
mitchell_pgh
Posting Junkie
Join Date: Feb 2000
Location: Washington, DC
Status: Offline
Reply With Quote
Oct 9, 2003, 03:31 PM
 
I do my shell scripts in TextEdit... works for me...
     
Angus_D
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Oct 9, 2003, 04:50 PM
 
Originally posted by daniel999:
theres already a "Hello World" when I start with a new project, but at the bottom line, its "return 0;". Is that the same as "return(0);" because thats what my tutor teaches me. is it different because its running on mac?
I've never seen return(0) before. If anything, it's old old archaic syntax (return isn't a function). I don't think it's valid ANSI C89.
     
theolein
Addicted to MacNN
Join Date: Feb 2001
Location: zurich, switzerland
Status: Offline
Reply With Quote
Oct 9, 2003, 04:56 PM
 
Originally posted by daniel999:
Thanks! it helps
but what is "cli"?

theres already a "Hello World" when I start with a new project, but at the bottom line, its "return 0;". Is that the same as "return(0);" because thats what my tutor teaches me. is it different because its running on mac?

Thanks
Isn't the "return(0);" C++? In C it's "return 0;" regardless of what platform you're on. Having a "return(0);" statement imples that a function called "return()" is being called, as opposed to the "return" statement in C (and in C++) which is a keyword. It implies a function that wraps return with perhaps some other functionality. You could also obfuscate (change) the return statement with a #define, so that "return 0;" becomes "return(0)".

If you have a lot of questions about coding though, I suggest you move over to the developer section of this forum, where there are more people who can help you.
weird wabbit
     
moki
Ambrosia - el Presidente
Join Date: Sep 2000
Location: Rochester, NY
Status: Offline
Reply With Quote
Oct 9, 2003, 05:32 PM
 
Originally posted by theolein:
Isn't the "return(0);" C++? In C it's "return 0;" regardless of what platform you're on. Having a "return(0);" statement imples that a function called "return()" is being called, as opposed to the "return" statement in C (and in C++) which is a keyword.
Nah, in both C/C++ the syntax is:

return expression

and ()'s are perfectly valid in any C/C++ expression. Same goes for many other C/C++ statements, such as switch

http://www.acm.uiuc.edu/webmonkeys/b....6.html#return

http://msdn.microsoft.com/library/de.../statem_18.asp
Andrew Welch / el Presidente / Ambrosia Software, Inc.
     
Earth Mk. II
Mac Elite
Join Date: Feb 2001
Location: Washington, DC
Status: Offline
Reply With Quote
Oct 9, 2003, 06:02 PM
 
Originally posted by daniel999:
Thanks! it helps
but what is "cli"?

theres already a "Hello World" when I start with a new project, but at the bottom line, its "return 0;". Is that the same as "return(0);" because thats what my tutor teaches me. is it different because its running on mac?

Thanks
CLI = Command Line Interface. A shell prompt (in Terminal.app) or command.com/cmd.exe in windows are examples of a CLI.

and I haven't seen "return(0);" anywhere before either, but, like moki said, it's just return expression, so it should work. Try it and find out.
/Earth\ Mk\.\ I{2}/
     
   
Thread Tools
 
Forum Links
Forum 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
Top
Privacy Policy
All times are GMT -4. The time now is 08:03 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,