You must first learn C language before learning C ++?

C ++ pronounced "C Gaga" is "C Plus Plus" for short. As the name suggests, C ++ is an increase on the basis of the new features of the C language, play out new tricks, so called "C Plus Plus", the relationship just like iPhone 7S and iPhone 7, Win10 and Win7 are.

Syntactically, C language is part of C ++, C language code without modification almost able to compile C ++ way, which gives a lot of beginners brought no small confusion, before learning C ++ in the end or else it must first learn C language ?

I remain neutral on this issue, but beginners learn C ++ directly will be very difficult, Hold live, especially in the case of computer memory not quite understand, learn C ++ do not understand. C ++ is a flexible, feature-rich language, also means more complex and difficult to master.

But it is clear: the time to learn the C language learning is equivalent to half of C ++, C ++ from C language shift, do not need to start from scratch, then you can learn C language down, so I strongly recommend that you learn C language again learn C ++. Here Insert Picture Description
In fact, as a developer, there is a learning atmosphere with a circle of exchange is particularly important here, I recommend a C language C ++ exchange group 583,650,410, whether you are white or switch to welcome people settled, everyone exchanges grow. Free open classes for you to learn!

Kinship C ++ and C language,
it seems, C ++ and C language, although two separate language, but they also have a pull pull clear of the relationship.

Early stage and no "C ++" this name, but called the "band class C". "Take the class C" is a C language, an extension of and complement appeared, it adds a lot of new syntax, aims to improve development efficiency, if you have Java Web development experience, then you can be their relationship with Servlet and JSP analogy of the relationship.

This period of C ++ very rough, only support simple object-oriented programming, but also not have their own compiler, but through a preprocessor (name cfront), first C ++ code "translated" for the C language code, and then by C compiler synthesis of the final program.

With the popularity of C ++, its syntax is more powerful, has been able to perfect the support process-oriented programming, object-oriented programming (OOP) and generic programming, it has become almost a separate language with its own compiler the way.

It is difficult to say with independent C ++ compilers, such as Microsoft compiler under Windows (cl.exe), GCC compiler under Linux, Clang compiler under Mac (Xcode has a default compiler, ambitious, determined to go beyond the GCC ), which supports both C and C ++, collectively referred to as C / C ++ compiler. For the C language code, compile them in the manner the C language; for C ++ code, it is compiled in accordance with C ++.

On the surface, C, C ++ code is compiled using the same compiler, so we said above, "the latter part of C ++ compiler has its own way", but did not say "have a C ++ compiler independent."

Besides C ++ tutorial
if you write a C ++ book for readers without any programming experience, it would be no small task, to write the book will be very thick. Even so, we are only talking about grammar.

More importantly, it is hard to absorb all this knowledge, you will be a serious blow to confidence, lose interest in learning.

My advice
without any programming based reader, I recommend starting with C linguistics from, do not bite off more than you can chew. There basics of programming readers believe that you can make the right judgments.

Learning to program is a gradual process, do not expect to eat a fat. Learning C language, one is learning its grammar, laying the foundation for the C ++, while developing programming interests, and second to learn the memory, compile and link, the internal mechanism of the programming language to clarify.

Each beginner experienced such a dilemma: have learned grammar, have to understand what programming language, follow the tutorial to knock a lot of code, but the practical problems encountered hung up, no idea, no idea where to start . It means not only learn with.

The reason is that less practice, no training program from thinking! Easy to learn, apply knowledge difficult!

So you are familiar with the C language, can write hundreds of lines of code, you have some idea of ​​the program. This time to go to understand C ++ What have they gained in the C language basis, you stand a certain height.

From the "academic" perspective, C ++ support process-oriented programming, object-oriented programming and generic programming, and C programming language only supports process-oriented. For it is process-oriented programming, C ++ and C are almost the same, so learning the C language, C ++ will learn in half, and do not need to start all over again.

Published 50 original articles · won praise 27 · views 30000 +

Guess you like

Origin blog.csdn.net/qq_43351159/article/details/104898819