getting started with C

"Please leave a message at the beep, we will get back to you when your support contract expires."

Moderators: phlip, Moderators General, Prelates

chrisgotter
Posts: 1
Joined: Tue Jul 17, 2012 10:18 pm UTC
Location: Poulsbo, Washington

getting started with C

Postby chrisgotter » Tue Jul 17, 2012 10:39 pm UTC

I am a CS student and I am trying to get a head start on my upcoming fall quarter. To this end I would like to learn C, I have had a hard time getting it set up on my PC, and was wondering if anyone could spare the time to walk me through this step by step or direct me to a good website that could help in this regard.
-chris

User avatar
ahammel
My Little Cabbage
Posts: 2135
Joined: Mon Jan 30, 2012 12:46 am UTC
Location: Vancouver BC
Contact:

Re: getting started with C

Postby ahammel » Tue Jul 17, 2012 10:56 pm UTC

I like this book.

By "PC", do you mean "computer running Windows"? My understanding is that's a pretty painful environment to learn pure C in (although I've never tried). You may want to look into a Linux partition or VM.
He/Him/His/Alex
God damn these electric sex pants!

ycc1988
Posts: 28
Joined: Fri Jun 22, 2012 5:13 am UTC

Re: getting started with C

Postby ycc1988 » Wed Jul 18, 2012 11:08 am UTC

http://www.mingw.org/wiki/Getting_Started/
If you ever advance to using makefiles, note that it's mingw32-make instead of plain make.

I don't know what book is best to get started, but one absolutely must own The C Programming Language. It's the C bible. It's also a very short book, C is not a complex language. That's what 3rd-party libraries are for.

FLHerne
Posts: 41
Joined: Fri Jan 13, 2012 9:44 pm UTC

Re: getting started with C

Postby FLHerne » Thu Jul 19, 2012 11:19 am UTC

ahammel wrote:By "PC", do you mean "computer running Windows"? My understanding is that's a pretty painful environment to learn pure C in (although I've never tried). You may want to look into a Linux partition or VM.
Windows is a painful environment to learn pure C in (I did try :P ). Linux (or even OSX, as a UNIX-like system) is much easier. If you do, KATE with the terminal plugin at the bottom and the right highlighting/indenting makes a nice IDE :D .

Of course, you might not be using Windows anyway, in which this post is entirely redundant and should be ignored 8) .

User avatar
Jorpho
Posts: 6197
Joined: Wed Dec 12, 2007 5:31 am UTC
Location: Canada

Re: getting started with C

Postby Jorpho » Fri Jul 20, 2012 5:28 am UTC

I might suggest Cygwin, which provides a convenient set of Unix-like tools in Windows. It works, but it feels like something of a kludge.

thicknavyrain
ThinkGravyTrain
Posts: 913
Joined: Sun Sep 30, 2007 12:41 pm UTC
Location: The Universe

Re: getting started with C

Postby thicknavyrain » Fri Jul 20, 2012 10:50 am UTC

This is pretty good, but it assumes you're using Xcode on a Mac:

http://www-teaching.physics.ox.ac.uk/co ... book_C.pdf

It can however be applied to any IDE if I recall correctly...
RoadieRich wrote:Thicknavyrain is appointed Nex Artifex, Author of Death of the second FaiD Assassins' Guild.

User avatar
Wnderer
Posts: 640
Joined: Wed Feb 03, 2010 9:10 pm UTC

Re: getting started with C

Postby Wnderer » Fri Jul 20, 2012 6:31 pm UTC

I learned with DJGPP but that was with Windows 95. I think it might work in DOSbox. If I was to start today I would use Microsoft Visual Studio C++, now that it is free.

http://www.microsoft.com/visualstudio/e ... ns/express

User avatar
Yakk
Poster with most posts but no title.
Posts: 11082
Joined: Sat Jan 27, 2007 7:27 pm UTC
Location: E pur si muove

Re: getting started with C

Postby Yakk » Fri Jul 20, 2012 6:57 pm UTC

Are you familiar with command line interfaces?
One of the painful things about our time is that those who feel certainty are stupid, and those with any imagination and understanding are filled with doubt and indecision - BR

Last edited by JHVH on Fri Oct 23, 4004 BCE 6:17 pm, edited 6 times in total.

User avatar
sam_i_am
Posts: 624
Joined: Mon Jun 18, 2012 3:38 pm UTC
Location: Urbana, Illinois, USA

Re: getting started with C

Postby sam_i_am » Fri Jul 20, 2012 7:35 pm UTC

My recollection is that it takes quite a bit of set-up in order to get windows to compile c programs, where I believe I think that some Linux installations come with a c compiler(gcc)

In this day and age, It probably shouldn't be too much trouble for you to obtain an old computer, reformat it and install linux onto it.

You can also install Visual Studio C++ 2010 express, which is free. It might also support C programs. I know that VS2008 professional did, but that doesn't necessarily mean that the express version does.

User avatar
ahammel
My Little Cabbage
Posts: 2135
Joined: Mon Jan 30, 2012 12:46 am UTC
Location: Vancouver BC
Contact:

Re: getting started with C

Postby ahammel » Fri Jul 20, 2012 7:46 pm UTC

sam_i_am wrote:My recollection is that it takes quite a bit of set-up in order to get windows to compile c programs, where I believe I think that some Linux installations come with a c compiler(gcc)

And even in the ones don't (including Ubuntu), getting it is just a matter of typing sudo apt-get install build-essential or similar.
He/Him/His/Alex
God damn these electric sex pants!

User avatar
Yakk
Poster with most posts but no title.
Posts: 11082
Joined: Sat Jan 27, 2007 7:27 pm UTC
Location: E pur si muove

Re: getting started with C

Postby Yakk » Fri Jul 20, 2012 7:58 pm UTC

You can get gcc on a PC via cygwin. You just have to find the checkbox for gcc.
One of the painful things about our time is that those who feel certainty are stupid, and those with any imagination and understanding are filled with doubt and indecision - BR

Last edited by JHVH on Fri Oct 23, 4004 BCE 6:17 pm, edited 6 times in total.

EvanED
Posts: 4330
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI
Contact:

Re: getting started with C

Postby EvanED » Sun Jul 22, 2012 5:03 am UTC

I'd also like to give a shout-out to clang, part of the LLVM project. You could use this instead of GCC, and I think there are native (maybe mingw-based?) builds for Windows.

User avatar
Idetuxs
Posts: 11
Joined: Thu Jun 16, 2011 12:33 am UTC

Re: getting started with C

Postby Idetuxs » Sun Jul 22, 2012 8:22 am UTC

Same as ycc1988:
You should check the book of the authors of C. "Kerningan y Ritchie - The C programming language".
Also, if it's about IDE's Geany runs on Windows too. (install mingw to get gcc)

User avatar
Yakk
Poster with most posts but no title.
Posts: 11082
Joined: Sat Jan 27, 2007 7:27 pm UTC
Location: E pur si muove

Re: getting started with C

Postby Yakk » Mon Jul 23, 2012 2:28 pm UTC

K&R is a good book to own, but not a good book for a beginner to learn C from.
One of the painful things about our time is that those who feel certainty are stupid, and those with any imagination and understanding are filled with doubt and indecision - BR

Last edited by JHVH on Fri Oct 23, 4004 BCE 6:17 pm, edited 6 times in total.

User avatar
Jplus
Posts: 1711
Joined: Wed Apr 21, 2010 12:29 pm UTC
Location: Netherlands

Re: getting started with C

Postby Jplus » Thu Jul 26, 2012 10:26 am UTC

EvanED wrote:I'd also like to give a shout-out to clang, part of the LLVM project. You could use this instead of GCC, and I think there are native (maybe mingw-based?) builds for Windows.

I second this.

Anyway, VC++ is not a pain to install (if your copy of Windows is legal, at least), and should work fine too. Cygwin and MinGW work, but... you'll always notice it's not native.
"There are only two hard problems in computer science: cache coherence, naming things, and off-by-one errors." (Phil Karlton and Leon Bambrick)

coding and xkcd combined

(Julian/Julian's)


Return to “The Help Desk”

Who is online

Users browsing this forum: No registered users and 6 guests