Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I need to learn as much C++ as possible, I'm a senior C# developer. Is there any good tutorial for that? Or a book?

And will it be difficult to learn C++? If you ask what I will do with C++, I have to get enough ability to make video processing application or image processing applications and whats the time period for that?

share|improve this question

migrated from stackoverflow.com Jun 18 '11 at 21:00

This question came from our site for professional and enthusiast programmers.

7  
The answer is: It depends. –  Mr E Jun 18 '11 at 20:58
3  
Start here: The Definitive C++ Book Guide and List. I'm sorry to say, but as a C# programmer that recently learned C++, I can tell you your knowledge of C# won't help much. I read "The C++ Programming Language", if you ask. –  R. Martinho Fernandes Jun 18 '11 at 20:59
    
Related: stackoverflow.com/questions/4395413/… –  Billy ONeal Jun 19 '11 at 2:41
    
This might be a bit helpful: msdn.microsoft.com/en-us/library/yyaad03b(VS.90).aspx –  Rei Miyasaka Jun 19 '11 at 2:49

6 Answers 6

up vote 6 down vote accepted

If you're already familiar with C#, the fasted way to get a good overview of modern (technically not-quite standard) C++ usage is to pop over to http://channel9.msdn.com/ and search for "Stephan Lavavej".

There are about 10 hours of the "Standard Template Library" course, and another 5 so far of "Advanced STL".

You'll also find plenty of other C++ videos here.

Although these STL videos focus on using the standard template library, and on the C++0x features currently available in Visual Studio 2010, they give a fairly good overview of how C++ as a whole works.

These aren't sufficient, though - a lot of important core-language material and idioms aren't covered.

Some language features you just won't bother learning, at least for a while. These include writing your own templates and using member pointers.

An important set of idioms to get used to early (especially coming from C#) are those related to timely destruction and using destructors to release resources other than memory. The RAII (Resource Allocation Is Initialisation) principle is related to exception safety in this context, but the term tends to get used in a wider sense to refer to the timely destruction issues in general.

What's RAII? Examples?

http://stackoverflow.com/questions/161177/does-c-support-finally-blocks-and-whats-this-raii-i-keep-hearing-about

LINQ is probably the biggest loss moving from C#, but C++0x does have some of the core-language requirements (type inference, lambda), and there are some third-party attempts to support LINQ-like libraries.

http://hjiang.net/archives/229

share|improve this answer

The good thing about learning C++ from C#, is that they look very similar. The bad thing is that they look very similar. You might feel I'm not making sense, but I'm trying to make a point. When I learned C++ coming from Java (I also know C#), I felt it was easy because their syntax are very alike, so that let me to made presumptions in which it made it harder to find the differences (very important differences) between the two.

While you can't go wrong on reading a 1500 C++ book, it might not be an optimal solution. You already have a programmer's brain, so you shouldn't start at the beginning of the line.

My First suggestion is to read tutorials highlighting the differences between the two: http://msdn.microsoft.com/en-us/magazine/cc301520.aspx and http://media.wiley.com/assets/264/22/0764557599_bonus_AppD.pdf Make sure you learn the differences, because at this point, you might be thinking in C# but coding in C++.

My second suggestion is then to read intermediate books highlighting the gotchas, the pitfalls and tricks. Scott Meyers' effective series, Stephen C. Dewhurst 2 books : gotchas and intermediate essential. After that, you want to look for Herb Sutter and Andrei Alexandrescu literature and the CPL book as well. Also, keep a copy of the standard.

My last two coins about learning C++, At the beginning of my C++ journey, I felt that I knew almost everything about it. Now that I have read many C++ books and C++ coding for the past two years, I feel that I know so little of C++. See the more you will know about C++, the more you realize how little you know about it. The reason that I'm telling you this is because a lot people underestimate C++. They usually don't pass the basics and don't go beyond their comfort zone and since the syntax might resemble their previous language, the easy-to-learn-C++ myth is born. So don't be me, treat C++ with a lot respect.

Good luck, Armando.

share|improve this answer
2  
I agree with that last paragraph. In a language like C# or Java, you don't try to learn the whole library - you learn the main ideas and the things you use every day, and look the rest up when you need it. In C++, the same applies to the core language. For example, you probably aren't going to be developing new container templates every day, so you probably don't need to memorise everything about templates. –  Steve314 Jun 19 '11 at 3:20
    
its good Point. –  Mustafa Ekici Jun 19 '11 at 7:50

Get Scott Meyers' books:

  • Effective C++, Third Edition, 2005. Scott's flagship book, fully revised for a new generation of C++ and C++ programmers. The best Effective C++ ever! Includes new material on resource management, templates, programming with exceptions, and much more.

  • Effective STL, 2001. 50 specific ways to improve your use of the STL, including techniques for improving performance, eliminating resource leaks, avoiding portability problems, and much more — all in Scott's inimitable style.

  • More Effective C++, 1996. An instant best-seller. Indispensable in its own right, and an invaluable companion to Effective C++. Includes detailed treatments of topics such as reference counting, smart pointers, proxy classes, double dispatching, and more.

share|improve this answer

For image processing, look into the OpenCV library. If you are a senior developer, it should not take you too long. Instead of asking the question, I would already be reading a book.

share|improve this answer

Aproach any new language like if you were a total beginner. In particular with C++.

The more experience you have with a first language, the faster you'll get in the new language you learn, but don't assume it's the same : each language is a different way of thinking and that's not by learning the syntax that you'll get good to it. Don't try to match exactly C# concepts on it.

Take a book for beginners in the language (there are tons of questions about this around here) and just humbly start reading it.

Now, the more languages you learn or play with, the faster you'll get the idioms of new languages because you'll have more learning elasticity in programming languages.

share|improve this answer

C++ and image/video processing are completely different things.

The later can be done in any language without or preferably with a 3rd party library.

Programming in C++ is just like programming in C#, just with a bit more flexibility and with your right hand tied behind your back.

Best way to learn C++ - trial and error, start by solving small problems and advance at your own pace.

Best way to learn image/video processing - start with theory e.g. academic courses' slides, experiment with Maltab, then with a language you are fluent in without libraries - C#, then C++ with a common library e.g. IPL.

share|improve this answer
1  
Programming in C# is very little like programming in C++. –  Billy ONeal Jun 19 '11 at 2:40
    
One of my profs at my university tried to teach C/C++, coming from Java. Needless to say, every slide was chock full of unbelievable errors, though I think a lot of them were the result of sheer stupidity rather than thinking that Java and C++ are similar (he didn't understand why it's not a good idea to start lecturing in the middle of an exam). –  Rei Miyasaka Jun 19 '11 at 2:52
2  
Trial and error? I don't think so! –  David Heffernan Jun 19 '11 at 7:44
    
Experimenting is the only way to really learn programming. –  Danny Varod Jun 19 '11 at 17:11
2  
@Billy ONeal, @David Heffernan, you completely missed my point - programming in C++ is like in C# with your right hand tied behind your back. In general C++, Delphi, Java, C# are all very similar. The are differences in memory management, strings, arrays, included libraries. However they do not differ as much as other languages do. Functions for more or less the same, loops do too, syntax is similar. If you actually write a few programs, you'll learn the best. Studying a program language from a book is like learning to drive from a book. The book can give you pointers, but its not the same –  Danny Varod Jun 21 '11 at 8:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.