[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 113: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 113: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 113: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 113: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 113: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
The Nightstar Zoo • View topic - Transitioning from C to C++

The Nightstar Zoo

Nightstar IRC Network - irc.nightstar.net
It is currently Tue May 21, 2019 11:11 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Sun Aug 07, 2005 9:03 pm 
Offline
Concession Worker
Concession Worker
User avatar

Joined: Tue Jul 01, 2003 5:26 pm
Posts: 1479
Location: R'lyeh
Two new threads in a single month! The end is nigh!


So... I am looking for good (and preferably free, although that isn't a strict requirement) resources for someone who already knows C but wants to learn C++. Most stuff I can find online either presumes that I have never programmed before in my entire life, or is well... just plain bad.

So I guess what I need is something that
1) Explains where and how C++'s intepretation of code differs from C's.
2) Explains OO from a C++ perspective (I have been at OOP before, I just don't think I can apply what little I know to C++).
3) Goes over all the new fun standard data types / functions / classes / whatevers.


Any suggestions?

_________________
Living in a state free from the burdens of privacy and democracy since 2008-06-18.


Top
 Profile  
 
PostPosted: Mon Aug 08, 2005 5:05 pm 


Top
  
 
 Post subject:
PostPosted: Mon Aug 08, 2005 9:18 pm 
Offline
Energizer Bunny
User avatar

Joined: Wed May 22, 2002 12:24 am
Posts: 1634


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 09, 2005 12:36 pm 


Top
  
 
 Post subject:
PostPosted: Wed Aug 10, 2005 6:26 pm 
Offline
Nightstar Graveyard Daemon
User avatar

Joined: Mon Jun 03, 2002 8:30 pm
Posts: 1071
Location: Wouldn't you rather observe my Velocity?
There is a fantastic book, if somewhat dated, called Class Construction in C and C++ by Roger Sessions. It does exactly what you're looking for: assumes you understand C, and walks you through the concepts of C++. It hangs on bravely to C throughout the first half of the book, in fact, explaining that you can get many of the features of C++ like vtables, the "this" object, and information hiding, just by using some habits and protocols. Remember that for the first few years, C++ was a preprocessor that turned your code into C code. (Hence weird artifacts like name mangling.)

In the second half of the book, the author finally throws up his hands and says, "We can't go any farther in C. Time for C++, and here's why." Then he gives the new features (like inheritance) a pretty good treatment.

The book is quite dated (1992), but I found it a profoundly useful read. It's exactly the book you're looking for, I think. It's available at Amazon.com's used book store for $1.10. You'll pay more for shipping than for the book!

http://www.amazon.com/gp/product/offer- ... dition=all

Note that the book won't make you a master of C++. You'll need to go on and read another work, Deitel wouldn't be a bad choice, or perhaps jump forward in time and dive right into the STL. But the book gave me a more solid grasp of the mechanics of C++ than most college graduates.

I put the knowledge from that book solidly to work as recently as 2003, when I was programming in the Windows Kernel, which is a C-only environment. I recommend this book highly to anyone working in C++, even today.

...and knowing why "typedef struct struct Foo;" isn't a syntax error is just gravy.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 11, 2005 6:47 pm 
Offline
Concession Worker
Concession Worker
User avatar

Joined: Tue Jul 01, 2003 5:26 pm
Posts: 1479
Location: R'lyeh

_________________
Living in a state free from the burdens of privacy and democracy since 2008-06-18.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 20, 2005 5:23 pm 
Offline
Concession Worker
Concession Worker
User avatar

Joined: Tue Jul 01, 2003 5:26 pm
Posts: 1479
Location: R'lyeh

_________________
Living in a state free from the burdens of privacy and democracy since 2008-06-18.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group