By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,969 Members | 2,175 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,969 IT Pros & Developers. It's quick & easy.

C++ for C programmer

P: n/a
I know C, and i want to learn c++. can someone recommend an on-line
source? - I also already know javascript. will that help?

Thanks.

~M

----
http://www.NovelTracker.com - top ten novels, ranked hourly.

Mar 13 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a
On Mar 13, 10:08 am, marywilliams1...@yahoo.com wrote:
I know C, and i want to learn c++. can someone recommend an on-line
source? - I also already know javascript. will that help?
See the FAQ:

http://www.parashift.com/c++-faq-lit...learn-cpp.html

I'd suggest you get _Accelerated C++_ by Koenig and Moo. It will teach
you the right way from the ground up (and help you unlearn some of the
C practices that may hinder your C++).

Cheers! --M

Mar 13 '07 #2

P: n/a
On Mar 13, 10:08 am, marywilliams1...@yahoo.com wrote:
I know C, and i want to learn c++. can someone recommend an on-line
source? - I also already know javascript. will that help?
Read this article first:

http://www.research.att.com/~bs/new_learning.pdf

Mar 13 '07 #3

P: n/a
On Mar 13, 8:44 am, "mlimber" <mlim...@gmail.comwrote:
I'd suggest you get _Accelerated C++_ by Koenig and Moo. It will teach
you the right way from the ground up (and help you unlearn some of the
C practices that may hinder your C++).
If there are any C practices that need to be "unlearned" they are
probably bad habits in C, also. My advice to C programmers (of which I
am one) is to focus on what you can do *easily* in C++ that is awkward
in C. If the interest is academic "I want to learn C++" then this is a
great approach.

If the interest is specific: "I need to refactor some code that uses
STL, with a custom allocator and it all looks like gibberish to me,"
then a more targeted approach is useful.

Either way, good C++ is a simplification of good C, and most C
programmers I know who have made the transition give this sigh of
satisfaction when they understand C++: "Ah, I always wanted something
that would persist type across a generic interface." or "Ah, I always
wanted something that would allow rigorous encapsulation AND automatic
allocation." etc. etc.
Mar 13 '07 #4

P: n/a
On Mar 13, 2:06 pm, "Bluejack" <bluuj...@gmail.comwrote:
On Mar 13, 8:44 am, "mlimber" <mlim...@gmail.comwrote:
I'd suggest you get _Accelerated C++_ by Koenig and Moo. It will teach
you the right way from the ground up (and help you unlearn some of the
C practices that may hinder your C++).

If there are any C practices that need to be "unlearned" they are
probably bad habits in C, also.
Not necessarily. Standard string processing in C is done with
pointers, while in C++ it is done with std::string. The latter is
generally much safer. In C, generic types are handled with void
pointers, while in C++ static and dynamic polymorphism are used. In
fact, most of the things that need to be unlearned are related to
pointers and arrays but are the preferred way of doing things in C.
See this FAQ:

http://www.parashift.com/c++-faq-lit....html#faq-34.1

Compare also:

http://www.parashift.com/c++-faq-lit....html#faq-28.2

We could add to the list declaring objects in as small a scope as
possible and only when they can be initialized (C makes you declare
your variables at the top of scope, perhaps before sensible
initialization is possible), using exceptions rather than return
codes, and relying on RAII for resource management. I'm sure there are
others.

Cheers! --M

Mar 13 '07 #5

P: n/a
On 13 Mar 2007 07:08:06 -0700, ma**************@yahoo.com wrote:
>I know C, and i want to learn c++. can someone recommend an on-line
source?
Bruce Eckel's 'Thinking in C++' is a good introduction to C++ for
programmers who already know C:
http://www.mindview.net/Books/TICPP/...ngInCPP2e.html
- I also already know javascript. will that help?
The more you know about programming the better.

Best wishes,
Roland Pibinger
Mar 13 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.