# Beginner C tutorial



## z662 (Jan 11, 2010)

Hello all,

I am a noob at C (not so much in other languages) but I wanted to work on my skills in hopes of someday contributing to BSD.  I was told that C is probably a better way to go vs. C++ for OS development (correct me if I am wrong) 

I wanted to know if anyone knew of or recommended anything as far as reading material and especially online tutorials as well as programming tasks to practice (tutorials and assignments).  When I googled for tutorials I became overwhelmed with primarily C++ tutorials, and I also wanted to ask people in this thread, as I would prefer opinions of people reading and posting on the BSD forums vs some random guy/gal on a blog.


----------



## danger@ (Jan 11, 2010)

I think you should go with http://www.amazon.com/Programming-L...=sr_1_1?ie=UTF8&s=books&qid=1263235631&sr=1-1. Then start reading the source code to get familiar with the code. This should give you into the structure of the FreeBSD.


----------



## z662 (Jan 11, 2010)

Awesome, I will have to bookmark the thread you linked me to, thanks.


----------



## expl (Jan 11, 2010)

http://www.cs.cf.ac.uk/Dave/C/CE.html

Is really good place to start learning C on a *BSD platform.


----------



## z662 (Jan 11, 2010)

Ok, I will take a look at that link tonight.  Thanks


----------



## LateNiteTV (Jan 11, 2010)

also, look into C Primer Plus.
this book teaches C with C99 in mind.
http://www.amazon.com/Primer-Plus-5...=sr_1_1?ie=UTF8&s=books&qid=1263242292&sr=1-1


----------



## Alt (Jan 11, 2010)

You can contribute docs too


----------



## anomie (Jan 11, 2010)

danger@ said:
			
		

> I think you should go with http://www.amazon.com/Programming-L...=sr_1_1?ie=UTF8&s=books&qid=1263235631&sr=1-1.



I'll second the K&R classic. I needed to learn C quickly for a project, and working through that book's examples and exercises was a great help. 

I recommend hanging on to the example programs, and writing your own test programs that each perform one simple task (i.e. to demonstrate how a particular language feature works). That'll be very useful as a reference later when you're working on a big program.


----------



## vigol (Jan 11, 2010)

> I'll second the K&R classic


is the best C Books for ever, but if you havn't any practice in a structural Language such as C 





> I am a noob at C (not so much in other languages)


,
it's better to start with *C How to Programme - Deitel* -- simultaneously keep an eye on file:///usr/share/doc/en_US.ISO8859-1/books/developers-handbook/index.html ---.
The former will give you a comprehensive knowledge about Structural progrmming, The Latter shall adopt those infos with FreeBSD/GCC.
The Example/Sample Testing/Reviewing methods is just practical for scripting languages such as perl/php --- although, just for introducing language and Hello World practices ---, and it will become more confusing progressively.


----------



## z662 (Jan 12, 2010)

Yeah it seems that I will take everyone's advice and get that book as well.  Also has excellent reviews everywhere.


----------



## Eponasoft (Jan 21, 2010)

The K&R book is ok, if not a bit dated and biased. You could also try this website:

http://www.cprogramming.com/


----------



## tiko (Apr 19, 2010)

Hate to revive an old thread, but no one mentioned the O'reilly book, C in a nutshell.  Though it is a reference book, it does have an introduction to C.  I have found it an invaluable resource in my daily programming.  It contains information on nearly every function you'll use over time (the C library) as well as information on things that some C books won't cover.  You'll find help on gcc, creating and using makefiles (also a great reference for sh scripting) and debugging with gdb.

This book is ridiculously thorough, up to date with C standards and will never collect dust on a bookshelf.


----------



## rden (Apr 27, 2010)

Eponasoft said:
			
		

> The K&R book is ok, if not a bit dated and biased.



Biased?  Biased to what?
Good clean correct & sensible code on a good clean & sensible OS [read unix/bsd] perchance?


----------



## sk8harddiefast (May 8, 2010)

Also me too i want to learn C but is so much difficult for me 
I want to learn for 2 reasons!!!
1)Because i really want to help bsd development
2)Because if i made it i want to create my own operating system based on bsd-solaris!!!
If i will not made it i will keep the first reason because i am really full in love with freebsd!!!!


----------



## jorgebarreto (May 14, 2010)

I also recommend the K & R and a C reference book, but if you can read
Portuguese this is good "IntroduÃ§Ã£o Ã  ProgramaÃ§Ã£o Usando C"
ISBN: 978-972-722-524-8 "and" ProgramaÃ§Ã£o AvanÃ§ada Usando C "
ISBN: 978-972-722-546-0. Search the Web for n1124.pdf the standard C
also the standard Unix System V3 (susv3.tar.gz) as a reference as well.
I find it very useful to learn the theory of things and recommend:
http://infolab.stanford.edu/ Ullman ~ / ialc.html
"Introduction to the Theory of Automata, Languages and Computation" and "Art of Computer Programming." IATLC The first will allow you to read and write better code in any language
the second shows ACP techniques that may be useful in different senarios.


----------



## sk8harddiefast (May 15, 2010)

> http://www.cs.cf.ac.uk/Dave/C/CE.html


Any way to download it?He ask password


----------



## expl (May 15, 2010)

Just use site download script(or app, havent used one in a while cant recall what I used), it will save all child .html files and images to local folder.


----------



## sk8harddiefast (May 15, 2010)

i haven't something like that in my mind but i think that will work


----------

