Jump to content

Good C/C++ Books?


Recommended Posts

I was wondering if anyone had any C or C++ books they find useful. While I've been using Java, I haven't programmed in C since high school so any good introductory book titles would be appreciated as well.

"When is this out. I can't wait to play it so I can talk at length about how bad it is." - Gorgon.

Link to comment
Share on other sites

kernighan and ritchie for C, is amazing. Its introductory, but I wouldn't recommend it to a first time C programmer. Condensed and consice, with a very good appendix.

 

Stroustrup for C++ I found was also very good. Its approach while is a bit advanced, and still introductory, it is superior to what I have seen the the SAMS books. I think it helps to deal with relevant problems.

 

EDIT: I know K&R's book is now ANSI, not sure about Stroustrup's.

 

EDIT: I also like C++ Primer.

Link to comment
Share on other sites

Depends slightly on you requirements. You said introductory, but introductory C or introductory C++ ? While having similarities they do differ somewhat in their architecture when "designing" programs.

 

Some books are better at introducing programming paradigms, others are more platform specific. Personally, I had a lot of use from "Teaching yourself C in 21 days" published by Sams (not sure of the exact name, was a long time ago). I needed to catch up with VS6 and Windows

“He who joyfully marches to music in rank and file has already earned my contempt. He has been given a large brain by mistake, since for him the spinal cord would surely suffice.” - Albert Einstein

Link to comment
Share on other sites

i have a question: since C++ was made to completely replace C, and C++ seems to be used a lot more than C nowadays, is it still worth learning C? say, if someone were to apply for a programming position at obsidian and they didn't know C, but they knew C++ (along with other languages) would you still consider hiring that person? or would you feel better working with someone who knew both C and C++?

i guess a second question would be: just how much is C used in the gaming business these days?

Link to comment
Share on other sites

If its a more general approach to C/C++ programming, TriCritical listed the "Bibles" :huh:

I have bought a lot of the 21 day books too, but the ones that need rebinding are the bibles. Its amazing how resourceful those stupid little books are. Even if they are not that helpful early on, I still think they need to be purchased at some point.

 

i have a question: since C++ was made to completely replace C, and C++ seems to be used a lot more than C nowadays, is it still worth learning C? say, if someone were to apply for a programming position at obsidian and they didn't know C, but they knew C++ (along with other languages) would you still consider hiring that person? or would you feel better working with someone who knew both C and C++?

i guess a second question would be: just how much is C used in the gaming business these days?

 

A programmer here went to see a talk by Stroustrup and said, "with C you can shoot yourself in the foot, while with C++ you can blow you're leg off." Or something like that.

 

That said C is the continuation of A and B, how suprising, and was meant to be able to provide a low level programming as well as be able to be a high level language as well.

 

As far as learning C, well C is ubiquitous and I mean that in every sense of the word. Its comes free on just about every non-Window's computer and is like the universal language of computers. I would bet that most compilers are even written in C. Not to mention that C++ uses the same syntax as C. Take Xt which is an objected oriented language that is a top layer for Xlib, which is written in C, is also written C. Not to mention old code does not dissapear and all that will be C. Furthermore, depending on what you are doing it might be more beneficial to do stuff in C.

 

For the most part, the fundamental difference in C++ is that it is Object Oriented. And like other languages such as JAVA, it has many built in object oriented features. Not to mention the ultra k3wl STD. And I am not talking about those diseases you get during R&R. Still I have read books that say its better not to know C, to learn C++, and that its actually better. But I just can't see how that is true.

Link to comment
Share on other sites

For OpenGL, I would skip the books entirely and just go through the tutorials on NeHe's site. There is plenty of material there to get you comfortable with OpenGL.

 

Since there is a link to this on this thread. I just want to point out that the Red book, or the Open GL Programming Guide is amazing. If you know C, and you want to know OpenGL, then its the only book you need. Unless you start doing some really advanced stuff, where you need to start interacting with glX and stuff.

 

Here's a link to the book,

 

The Red Book

 

Not sure if its legal, but I think SGI has a link too, this dude just made it easy to read.

Link to comment
Share on other sites

I'd like to thank everyone for their suggestions. I appreciate all of them.

 

I don't think I'll start on OpenGL until I get a good handle on C++ it's good to know what I'll need to be learning.

 

I've been told that C++, OpenGL, and DirectX are the most important languages to learn for gaming but someone else also mentioned Cg. Also, for graphics, what programs would you recommend? I have Maya 5.0 but I've been told that 3D Max is considered a better tool.

"When is this out. I can't wait to play it so I can talk at length about how bad it is." - Gorgon.

Link to comment
Share on other sites

That said C is the continuation of A and B, how suprising, and was meant to be able to provide a low level programming as well as be able to be a high level language as well.

Now I become a real geek. C++ evolved from C, yes. C evolved from B, yes. B however evolved from BCPL (it was a "light" version of BCPL and got the short name B :blink:)

“He who joyfully marches to music in rank and file has already earned my contempt. He has been given a large brain by mistake, since for him the spinal cord would surely suffice.” - Albert Einstein

Link to comment
Share on other sites

That said C is the continuation of A and B, how suprising, and was meant to be able to provide a low level programming as well as be able to be a high level language as well.

Now I become a real geek. C++ evolved from C, yes. C evolved from B, yes. B however evolved from BCPL (it was a "light" version of BCPL and got the short name B :lol:)

You pwnd me.

 

My revenge...

 

This all happened before I was born.

 

:rolleyes:

 

EDIT, I should talk though, considering I enjoy 16 bit ASM.

Link to comment
Share on other sites

Or, one could go microsoft fanboy and learn C# (very nice language).. Full Directx9 support in there. Bad thing is that it uses a middlelanguage and the .net platform (like Java, but not really) and as far as I can tell, it will never become as fast as C++.

 

Oh, and Visual Studio.net costs money. I think there's a command line C# compiler though..

"You have offended my family, and you have offended the Shaolin temple." Bruce Lee, Enter the Dragon

Link to comment
Share on other sites

Or, one could go microsoft fanboy and learn C# (very nice language).. Full Directx9 support in there. Bad thing is that it uses a middlelanguage and the .net platform (like Java, but not really) and as far as I can tell, it will never become as fast as C++.

 

Oh, and Visual Studio.net costs money. I think there's a command line C# compiler though..

The new Windows API for Longhorn really encourages the use of C# and the .NET architecture.

 

In fact, I think the API only supports C#, .NET and VB.

 

So it may be wise to get a head-start and learn C#.

Link to comment
Share on other sites

Well, Longhorn is in beta. Things can change. And Longhorn should run older Windows apps programmed in the older API.

 

However to take advantage of Longhorn's new features, you need to program in the new API. One of the things Longhorn does is allow you to launch an application remotely over the net, or an intranet even if it's not installed on your machine. I can write a full Windows program in the new API, taking advantge of everything Longhorn offers, and put it on my website. You can run it 100% remotely.

 

It's both wonderful and scary. It also sounds alot like what Java promised years ago before MS screwed with Java. (Sun really should have won that suit). Yet with Java, it ran on any platform. You'll need Longhorn to run a Longhorn app remotely.

 

It's clever business-wise, yet evil.

Link to comment
Share on other sites

However to take advantage of Longhorn's new features, you need to program in the new API. One of the things Longhorn does is allow you to launch an application remotely over the net, or an intranet even if it's not installed on your machine. I can write a full Windows program in the new API, taking advantge of everything Longhorn offers, and put it on my website. You can run it 100% remotely.

Unix has been doing this for the last 25 years, at least. MS is way late to the game, and make pretty good fascist of the software industry making the youngsters feel that this is new.

 

BTW, I am 100% not kidding.

Link to comment
Share on other sites

You can run unix programs across a network, but unix doesn't have any web-applications I've seen that run client-side.

 

Unix and Windows are so night and day different. I use Unix all day at work on our RS/6000 servers. I use Windows at home. I used to dual-boot Linux/Windows, but what's the point? I can't run most of my games in Linux. Gimp is a horrible graphics program. I use both Photoshop and PaintShop Pro all the time.

 

Different operating systems have their uses. If I throw my BBS back online, it will likely be a Linux box. I don't really forsee myself using Linux for anything anytime soon. The SW MUD I'm programming will be run on a Unix server, but more than likely a paid server and not my bandwidth.

 

I don't consider one operating system to be better or worse than others. (Not since the death of OS/2 Warp) I just use whichever operating system is appropriate for each instance. For instance, I have Win2k machines, and WinXP machines. I even vary between Windows operating systems.

Link to comment
Share on other sites

I don't consider one operating system to be better or worse than others. (Not since the death of OS/2 Warp)

Ok, enlighten me: was OS/2 Warp better or worse? You failed to mention which camp it belonged in.

Swedes, go to: Spel2, for the latest game reviews in swedish!

Link to comment
Share on other sites

I was a big OS/2 Warp fan.

 

It ran dos applications great. It ran Windows applications, and often faster than Windows ran the same applications. It also ran OS/2 applications. I ran a BBS on OS/2 in the day. It handled multitasking and the multiple-nodes rather well. People would also drop-carrier in the middle of something. Even Unix, for all it's stability, throws a fit when a job is left hanging because someone loses connectivity. OS/2 eliminated a lot of crashes.

 

It had great multitasking in comparison to Windows horrid time-slicing routines. It was fast, stable and flexible. Those are the three traits most operating systems should strive for. I still contend that most OSes today cater to different uses. OS/2 and Windows fought for the same niche.

 

OS/2 went the way of beta-max.

Link to comment
Share on other sites

You can run unix programs across a network, but unix doesn't have any web-applications I've seen that run client-side.

Define web?

 

We have tons of dummy terminals at my work, that run nothing but X, with all applications being run on the server side.

 

Unix and Windows are so night and day different. I use Unix all day at work on our RS/6000 servers. I use Windows at home. I used to dual-boot Linux/Windows, but what's the point? I can't run most of my games in Linux. Gimp is a horrible graphics program. I use both Photoshop and PaintShop Pro all the time.

 

I don't think Gimp sucks, of course I never mentioned Linux either. SGI's are quite adept at dealing with graphics, as the imfamous CG movies will point out. And you can't run most of your games on Linux, because developers don't make them for Linux. Is this suppose to be a knock on Linux, or Developers?

 

I actually use Linux for everything at work too, including ms office which runs on a the crossover wine emulator.

 

It had great multitasking in comparison to Windows horrid time-slicing routines.

 

It still does.

Link to comment
Share on other sites

Define web?

 

We have tons of dummy terminals at my work, that run nothing but X, with all applications being run on the server side.

I think that's the point. Dummy terminals offload the work to the server. Dynamic websites do the same (like this forum) and only make the client worry about displaying the end result. The XAML/Avalon/Longhorn thing is to have network applications run on the client. The .NET framwork already defines most of the functionality and Avalon defines the interface, so the applications are very thin. This means the applications run in realtime, transferring only the data needed to interface with the server (as opposed to html/js/css apps where you need to send a request and get a page back each time you want to transfer something). This is very cool. The only framework like this on linux is J2EE or E17, which is perpetually unfinished.

 

Yes, it would have been unevil of them to make it an open standard, but at least they aren't sueing Mono out of existance.

 

For now.

 

MUAHa. Ha.

ha.

 

Also, Longhorn/.NET uses C++, Managed C++. You get all the speed benefits of C# with all the elegant clarity of C++!! ( << sarcasm )

 

ugg. What was this thread about again? Oh, books. The C++ Primer by Lippman is good. Thorough, like Stroustrop's, but reads much easier, in my opinion.

Oh Jimmy, you were so funny.

Don't let me down.

From habit he lifts his watch; it shows him its blank face.

Zero hour, Snowman thinks. Time to go.

Link to comment
Share on other sites

The XAML/Avalon/Longhorn thing is to have network applications run on the client. The .NET framwork already defines most of the functionality and Avalon defines the interface, so the applications are very thin. This means the applications run in realtime, transferring only the data needed to interface with the server (as opposed to html/js/css apps where you need to send a request and get a page back each time you want to transfer something). This is very cool. The only framework like this on linux is J2EE or E17, which is perpetually unfinished.

I think understand. Its just new API's for what was previously handled by WinSock, or sockets in general. Again not as evolutionary as made out to be, but I at least think I understand now. ;)

 

The C++ Primer by Lippman is good. Thorough, like Stroustrop's, but reads much easier, in my opinion

 

I like both of these books too. My only complaint about Primer, is that I don't like its examples.

Link to comment
Share on other sites

I think understand. Its just new API's for what was previously handled by WinSock, or sockets in general. Again not as evolutionary as made out to be, but I at least think I understand now. ;)

I agree. When I read about Longhorn for the first time, it struck me as being innovative until I really thought about it. That's why I compared it to what Java already did to an extent and pointed out that Java atleast supported multiple platforms while Longhorn's new client-side applications are platform dependent.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...