New to C Programming in Linux

Code junkies hangout here

Moderators: ChrisThornett, LXF moderators

New to C Programming in Linux

Postby GMorgan » Fri Jan 20, 2006 3:47 pm

Does anyone know a decent online guide to C programming in Linux. Preferably it would contain quirks in comparison to standard C and how to get from a *.c code to a running program (tried messing with GCC to no avail so far), I've been using KDevelop but I can't find an embedded compile/run function so I assume your supposed to run GCC from the command line as included at the bottom. I've tried typing gcc *.c it gives me a file a.out which I'm not sure how to get running.

Have already looked at the Wiki but it only does C++ with no decent reference to C itself.

Cheers.
GMorgan
LXF regular
 
Posts: 684
Joined: Thu Jan 12, 2006 6:58 pm
Location: South Wales, UK

Postby comcamel » Fri Jan 20, 2006 4:13 pm

well, even if i haven't given it a go c++ or whatever , look at some simple opensource programs that have a use and you may learn easier how to do stuff, and how to construct things. I am quite good a php now, and i haven't even bought a book or out and only occasionllay looked at tutorials
comcamel
LXF regular
 
Posts: 205
Joined: Thu Apr 07, 2005 5:35 pm

Postby GMorgan » Fri Jan 20, 2006 4:19 pm

I know a little about C programming in itself but have been struggling to actual get to the stage where code becomes executable program. No matter what switches I use with GCC nothing workable seems to come out.

Its actually ironic, on Windows I would use the Borland command line compiler and would have 2 command promps and a text editor open because I couldn't afford their IDE. Now in Linux I have a decent IDE but can't get anything to work despite the program all looking pretty. Talk about role reversal.
GMorgan
LXF regular
 
Posts: 684
Joined: Thu Jan 12, 2006 6:58 pm
Location: South Wales, UK

Postby M-Saunders » Fri Jan 20, 2006 4:22 pm

Ultra-quick GCC usage guide:

gcc file.c -o prog

Compiles file.c into 'prog'. Then run with

./prog

M
User avatar
M-Saunders
LXF regular
 
Posts: 2893
Joined: Mon Apr 11, 2005 12:14 pm

Postby GMorgan » Fri Jan 20, 2006 4:24 pm

Cheers, seems to work fine now.
GMorgan
LXF regular
 
Posts: 684
Joined: Thu Jan 12, 2006 6:58 pm
Location: South Wales, UK

Postby Lejon » Fri Jan 20, 2006 11:40 pm

I am the one you thought I was! Just not the way, you expected...
User avatar
Lejon
LXF regular
 
Posts: 150
Joined: Wed Oct 19, 2005 7:24 pm
Location: Sweden


Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest