Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   C (http://www.programmingforums.org/forum60.html)
-   -   book, version, compiler (http://www.programmingforums.org/showthread.php?t=15664)

mrynit Apr 20th, 2008 6:04 AM

book, version, compiler
 
I am a computer engineering student. I want to learn C for the follwoing reasons
  • program mirco controllers
  • make drivers
  • make an OS
  • general software
  • linux programming
I want a book (I don't like reading e-books) to read to learn C. I already have this book http://www.amazon.com/Programming-AN...dp/0672303396/, which does have good review. I have not read much of it yet. A lot of people like and recomend this book http://www.amazon.com/Programming-La...dp/0131103628/.

There are many different C versions to date. I know K&R is the frist standard and is the core of modern C versions. Next comes all the ANSI/ISO versions. The two books I listed cover the first ANSI C version. My question is what version of C do I learn with respect to what I want to do?

Same as versions, there are multipule C/C++ compilers. I assume gcc is the "best" one out there, as I am leaning more towards the linux side of programming. For mircocontrollers I have seen FOSS compilers for families of controllers.

I know some of the things I want to do can be done using C++. I would prefer to learn C first before moving into the OOP of C.

Narue Apr 20th, 2008 8:24 AM

Re: book, version, compiler
 
>I want to learn C for the follwoing reasons
That covers a lot of ground...

>I already have this book http://www.amazon.com/Programming-AN...dp/0672303396/
Yes, it's pretty good. However, you have an older edition.

>A lot of people like and recomend this book http://www.amazon.com/Programming-La...dp/0131103628/.
For good reason. K&R was the book that a lot of people learned C from. However, it's not the best option if C is your first language, and the newest edition only covers C89.

>There are many different C versions to date.
K&R C is the dialect of C described in the first edition of K&R.
C89 was ANSI's attempt to standardize the language in 1989.
C90 was ISO's takeover of C89 in 1990 (only very minor changes).
C95 was the first amendment of C90 in 1995 that focused primarily on corrections and internationalization features.
C99 is the current standard (ratified in 1999), and makes sweeping changes.
C0x is the presumed next standard.

>My question is what version of C do I learn with respect to what I want to do?
Most C programmers stick to a common subset of C95 and C99 so that they can be portable now, yet remain portable when C99 is fully assimilated. I'd recommend that you learn C99, but refrain from using too many of the latest and greatest features.

"C Primer Plus" by Stephen Prata is a good beginner's book, and the 5th edition covers C99. Generally, you should look for C books to be written within the last five years or so, as anything older is highly likely not to cover C99. Even with the five year leeway, you still might see books that don't cover the latest standard. :icon_rolleyes: However, keep in mind that if you want to master C, your collection of books down the road will probably range from the mid '80's to the present.

>I assume gcc is the "best" one out there, as I am leaning more towards the linux side of programming.
"Best" is subjective. Intel has a fantastic compiler, and they offer it for free on Linux for non-commercial use. GCC has the benefit of coming bundled with most installations of Linux. Both support large portions of C99.

Jabo Apr 20th, 2008 4:17 PM

Re: book, version, compiler
 
I've got a C++ and a Java book by Barbara Johnston and they are decent for beginning programmers. She does a pretty good job of explaining things so that you understand the process. I'm sure she probably has a book for C.

colin mac Apr 20th, 2008 5:32 PM

Re: book, version, compiler
 
Two C books I have and find good.
http://apress.com/book/view/9781590597354
http://www.oreilly.com/catalog/pcp3/

Code::Blocks is a nice C\C++ IDE, and just went through a recent update.

Dev 666 Apr 20th, 2008 7:20 PM

Re: book, version, compiler
 
as with any "book" search, search the internet as well. whatever is better for you is fine, but try good internet searches as well. google will do wonders for you if you know how to work it.

Jabo Apr 20th, 2008 7:33 PM

Re: book, version, compiler
 
There's also a good free book online called Thinking in C, forget the guys name though.

Narue Apr 21st, 2008 7:05 AM

Re: book, version, compiler
 
>Thinking in C, forget the guys name though
Bruce Eckel, but I thought Thinking in C was still in beta.

BstrucT Apr 21st, 2008 8:31 AM

Re: book, version, compiler
 
Beej's guide to C

http://beej.us/guide/bgc/

It may be an e-book, but I love the light hearted humor in this.

Quoted from chapter 7: Pointers

Quote:

Because they, quite honestly, can cause electric shocks to come up through the keyboard and physically weld your arms permantly in place, cursing you to a life at the keyboard.
:|

haha!

>BstrucT

mrynit Apr 21st, 2008 3:35 PM

Re: book, version, compiler
 
@Narue
If I used the book(published 1994) I have, which is ANSI C (does that mean C89?) would that be ok? After I finish that book I would need to get one that covers the new changes in C99.

Narue Apr 21st, 2008 4:15 PM

Re: book, version, compiler
 
>If I used the book(published 1994) I have, which is
>ANSI C (does that mean C89?) would that be ok?
Sure.


All times are GMT -5. The time now is 3:52 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC