The question we tried to answer I think is whether you need to learn C first, in order to learn C++.
The answer is an emphatic no!
This is not saying you shouldn't learn C, but you don't need to understand C in order to understand C++. In fact, having learnt C++, you will find it easier to learn C.
The danger is this, if you learn C first, as a way of learning C++, you're likely to try and use C++ the same way you use C. C++ has many features, and fosters a very different mindset and approach to programming. Having first tackled these concepts in C, it is much harder to come around to the C++ way of doing things. This means you most likely will not use many new features, and in particular the new mindset fostered by C++, and will still be stuck with many terrible problems that have plagued C programmers for decades. The reverse is different, having mastered the C++ paradigms, you will be able to do procedural programming in C, in a very different, more modern and effective way.
I believe that
learning modern C++ first, will actually make you a better C programmer in the long run.
My advice is to learn both if you have the time and energy, but learn C++ first, and give yourself a lot of practice with it, especially explore generic programming paradigm and use of the standard library, before learning C.
In reality, if you are careful, you can write programs that will be 100% conforming in C++11, C++98, C99 and C89 at the same time, simply by avoiding the incompatible features. Most ANSI C89 conforming programs will compile without change when treated as C++98.
Having said that, C++ provides strong support for generic programming, object oriented programming and procedural programming, meaning you can use these paradigms with ease in C++, they are supported by the language and standard library.
On the other hand you could do OO or generic in C as well, but neither the language nor it's standard library supports this, so you find yourself manually doing the work of a compiler and 100s of expert library authors. It's possible, in the same way it's possible to jump into an active volcano and survive, but it's a hassle and will most likely result in disaster.
Now about the Windows API:
To use and understand Windows API, I don't need C++ at all. Am I right? |
Yes, you're right! As pointed out previously, there are thousands of Windows programmers using Javascript, Python, C#, Java, Pascal, every language imaginable, that don't know any C. or C++.
I think I understand where you're coming from though, so let me put it this way:
they are intentionally made compatible with both languages |
In the MS documentation explaining the API, the examples are shown using C, and you've seen the function prototypes and data structures all in C - but that is all old C, AFAIK, there is nothing there that is not legal C++. To put it better, There is nothing in there you wouldn't understand if you already know C++.
You may not realise it yet, but what you're worried about isn't programming in C++, it's programming for Windows. You wonder about understanding and effective use of the Windows API, since it appears "to be C", but that worry is unfounded. Remember, you are using the API, not creating it.
Final suggestion, get a copy of one of Ivor Horton's Beginning Visual C++ series, where he teaches both C++ and Windows programming, scan the sections on Windows programming and see if that doesn't set your mind at rest.