|
|
c programming
|
|
|
|
Fresh-Faced Recruit
Join Date: Apr 2007
Status:
Offline
|
|
hii every one. can anyone help me in C programming on mac
i got a new mac but i have lot of work with C programming..
i dont want to go with bootcamp or virtual PC just for C programming
is there any application which can run c programming..
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
The Xcode Tools should be included with your system. Just install those and you're set.
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
|
|
|
|
|
|
|
Posting Junkie
Join Date: Dec 2000
Status:
Offline
|
|
If you don't have the XCode tools for some reason, you can download them for free from ADC Member Site (you'll have to sign up for a free Online ADC account).
|
|
|
|
|
|
|
|
|
Fresh-Faced Recruit
Join Date: Apr 2007
Status:
Offline
|
|
Thanks for ur replay for my question on "C" programming i have installed the xcode but. i dont know what to do next i mean where should i write the programm and can i compile that programm. for my results..
thank you again
kapil ayyawar
|
|
|
|
|
|
|
|
|
Addicted to MacNN
Join Date: Aug 2004
Location: FFM
Status:
Offline
|
|
File->New Project->Command Line Utility->Standard Tool
Give the project a name and then click the "Build & Run" button and you have made and run your first C-program. Edit the file main.c that you can find in the "Groups & Files" list at will to create your own program.
|
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status:
Offline
|
|
or to do it the traditional way, on the CLI, use vi to edit the code, and gcc (or g++) to compile it.
But using the XCode is much easier. It uses gcc internally, anyhow. It is located at: /Develope/Applications (after you've installed the developer tools)
|
|
|
|
|
|
|
|
|
Fresh-Faced Recruit
Join Date: Mar 2007
Status:
Offline
|
|
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Originally Posted by Wee
what about C++ ?
Same. GCC supports several languages, including C++.
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
|
|
|
|
|
|
|
Posting Junkie
Join Date: Feb 2000
Location: Washington, DC
Status:
Offline
|
|
Originally Posted by Brass
or to do it the traditional way, on the CLI, use vi to edit the code, and gcc (or g++) to compile it.
But using the XCode is much easier. It uses gcc internally, anyhow. It is located at: /Develope/Applications (after you've installed the developer tools)
I wouldn't recommend this for someone starting out. I would use Xcode for now and when you figure out the limitations of it, move on.
|
|
|
|
|
|
|
|
|
Fresh-Faced Recruit
Join Date: Apr 2007
Status:
Offline
|
|
Hii everyone..
I have been using Xcode to write C programs. It works great..
but i have been using some of the gnu functions.. which need gnu scientific library
installed in it. I don't know how to install gnu scientific library into Xcode.
Is anyone can help me to install gnu library into Xcode.
thanks in advance.
Kapil Ayyawar.
|
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Jun 2005
Status:
Offline
|
|
|
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Jul 2002
Status:
Offline
|
|
As a good general purpose editor (no fancy IDE development stuff or anything), you may also want to look into BBEdit. It's like NotePad++ on Windows.
|
|
|
|
|
|
|
|
|
Senior User
Join Date: Sep 2000
Location: Glasgow, Scotland UK
Status:
Offline
|
|
Or if you interested in plain text editors I like SubEthaEdit a little less pricey that BBEdit and comes with a handy collaboration feature if you have friends you code with who are Mac users.
(
Last edited by ntsc; Feb 19, 2008 at 08:37 AM.
Reason: screwed up the markup)
|
"You can't waste a life hating people, because all they do is live their life, laughing, doing more evil."
-ALPHA ROBERTSON,whose daughter was one of four girls killed in the bombing of a Birmingham, Ala., church in 1963.
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Mar 2003
Status:
Offline
|
|
Wow sounds really nooby but I didn't know Xcode could do that!
Got quite frustrated trying to learn C from a book cos I couldn't even the book's compile and run instructions to work on Terminal:
It says to compile with "cc name.c" and then to run "a.out".
The simple program compiles with no problems and generates the a.out file, but typing "a.out" as the book suggests returns command not found
Does anybody know what's going on?
Works great on Xcode
|
|
|
|
|
|
|
|
|
Fresh-Faced Recruit
Join Date: Feb 2008
Status:
Offline
|
|
Try ./a.out
Your path may not include the current directory, and it is not finding the a.out
|
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Mar 2003
Status:
Offline
|
|
Originally Posted by anilnair
Try ./a.out
Your path may not include the current directory, and it is not finding the a.out
Hi Anil thanks for the reply - it works! What's going on behind the scenes that makes it work now? Why is it that it doesn't work when I navigate to the proper directory before compiling and running the file?
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Originally Posted by naphtali
Hi Anil thanks for the reply - it works! What's going on behind the scenes that makes it work now? Why is it that it doesn't work when I navigate to the proper directory before compiling and running the file?
When you type a naked command (like "a.out"), it searches a predefined set of directories — contained in the environment variable PATH — for a matching executable. If the current directory isn't in that list, it won't bother looking there. The first dot in "./a.out" refers to the current directory, so that command means "run the program a.out that's in the current directory."
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Mar 2003
Status:
Offline
|
|
Originally Posted by Chuckit
When you type a naked command (like "a.out"), it searches a predefined set of directories — contained in the environment variable PATH — for a matching executable. If the current directory isn't in that list, it won't bother looking there. The first dot in "./a.out" refers to the current directory, so that command means "run the program a.out that's in the current directory."
Thanks! It doesn't seem to intuitive to me though, that it might look elsewhere but the current folder Perhaps for frequent shortcuts and stuff. Will go brush up on Unix paths etc
Have a great weekend!
|
|
|
|
|
|
|
|
|
Posting Junkie
Join Date: Dec 2000
Status:
Offline
|
|
It's for security, I think - if typing a command searched the current directory, someone could stick a malicious program named "ls" into your home directory, and then if you opened up a Terminal window and typed "ls", whoops, you just ran the malicious program instead of ls. It would get particularly nasty if you put sudo in front of the command.
|
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Mar 2003
Status:
Offline
|
|
Originally Posted by CharlesS
It's for security, I think - if typing a command searched the current directory, someone could stick a malicious program named "ls" into your home directory, and then if you opened up a Terminal window and typed "ls", whoops, you just ran the malicious program instead of ls. It would get particularly nasty if you put sudo in front of the command.
Thanks! Makes sense! My *nix-fan brother-in-law and I were discussing it and we came to the same conclusion too
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|