Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 04-05-2008, 03:43 PM   #1 (permalink)
 
Super Techie

Join Date: Jul 2006

Posts: 486

ZeroShade is on a distinguished road

Default Running C program

How do I run a C program in ubuntu's terminal?
__________________
Live And Let Learn.
ZeroShade is offline  
Old 04-05-2008, 04:46 PM   #2 (permalink)
peterhuang913's Avatar
 
Retired.

Join Date: Dec 2005

Location: Los Angeles, California

Posts: 8,090

peterhuang913 is an unknown quantity at this point

Send a message via AIM to peterhuang913
Default Re: Running C program

What do you mean a C program?
__________________


My computer uses 1.5A-load, .8A-idle, .65A-standby, .05A-turned off on 125V.
"The spaces between your fingers were created so that another's could fill them in."
Quote:
Originally Posted by Norcent View Post
I need to stop using the internet.
peterhuang913 is offline  
Old 04-06-2008, 02:11 AM   #3 (permalink)
S0ULphIRE's Avatar
 
01001100011011110110110

Join Date: Mar 2007

Location: Perth, Australia

Posts: 1,988

S0ULphIRE has a spectacular aura aboutS0ULphIRE has a spectacular aura about

Send a message via MSN to S0ULphIRE
Default Re: Running C program

^ I think he means some C code (a program he's written).^
__________________
"As a result of all this hardship, dirt, thirst, and wombats, you would expect Australians to be a dour lot. Instead, they are genial, jolly, cheerful, and always willing to share a kind word with a stranger, unless they are an American."
-- Douglas Adams

Click this if I helped you
>>>><<<<
S0ULphIRE is offline  
Old 04-06-2008, 04:31 AM   #4 (permalink)
void's Avatar
 
True Techie

Join Date: Oct 2005

Posts: 198

void

Default Re: Running C program

If its a program you've written , then from the directory your program is in.
Code:
./myprogram
If it a system program such as cat or ls.
Code:
cat file.txt

void is offline  
Old 04-07-2008, 06:08 PM   #5 (permalink)
 
Super Techie

Join Date: Jul 2006

Posts: 486

ZeroShade is on a distinguished road

Default Re: Running C program

I'm trying to follow a tutorial in a book i bought. It tells me to type ~/booksrc ls gcc firstprog.c
But it just spits the folder name back out and says its a directory. I checked where the file was... it is in ~/booksrc. Any ideas?
__________________
Live And Let Learn.
ZeroShade is offline  
Old 04-13-2008, 03:09 AM   #6 (permalink)
Baez's Avatar
 

Join Date: Sep 2005

Location: Toronto, Canada

Posts: 5,470

Baez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of light

Default Re: Running C program

To compile the program using gnu you only need to use "gcc" if you're in the folder containing the C program.
__________________

Baez is offline  
Old 05-10-2008, 04:03 AM   #7 (permalink)
mattew's Avatar
 
Banned

Join Date: May 2008

Posts: 147

mattew is on a distinguished road

Send a message via MSN to mattew
Default Re: Running C program

u will first have to open the VI editor and write the code in it.
make sure u dont use ne of the header file pertainig to graphics in it (sometimes it doesnt work) save the code with xtension .c
then u must compile using gcc
the code is "gcc -c main.c"(where main is name of ur file dont use quotes)
is its a c++ program the use
"g++ -c main.cpp"
mattew is offline  
 
Closed Thread

Thread Tools
Display Modes

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 On


Similar Threads
Thread Thread Starter Forum Replies Last Post
BFG Announces Graphics Card 100 Day Trade Up Program Osiris Other Computer HW Topics 5 03-18-2008 08:34 PM
Join The Windows Feedback Program and grab some free apps Osiris Windows Operating Systems and Software 4 12-14-2007 05:45 PM
friends log Static_11 HijackThis Logs (finished) 11 11-25-2007 10:27 PM