Why is C faster than C, and why is C so hard?

Updated on technology 2024-02-08
18 answers
  1. Anonymous users2024-02-05

    C is process-oriented.

    C++ is object-oriented.

    C++ was created with the intention of "a better C", but that doesn't mean that C++-like global variables and functions are compiled and concatenated in exactly the same way as C. As a language that is to be compatible with C, C++ retains some of the characteristics of a procedural language (known as "not thoroughly object-oriented"), so it can define global variables and functions that do not belong to any class. However, C++ is an object-oriented programming language, and in order to support the overloading of functions, C++ treats global functions in a significantly different way than C.

    C is a structured language. The first consideration in the design of C programs is how to calculate and process the input (or environmental conditions) through a process to obtain the output (or realize process (transaction) control), and for C++, the first consideration is how to construct an object model, so that this model can fit the corresponding problem domain, so that the output or process (transaction) control can be obtained by obtaining the state information of the object.

    So the biggest difference between C and C++ is that they don't have the same way of thinking about solving problems. The reason why C++ is more advanced than C is because "the concept of design has been integrated into C++", and in terms of the language itself, in C it is more about the concept of algorithms. Then it doesn't matter if it's c or not, wrong!

    Algorithms are the foundation of program design, and good design is not good if there are no good algorithms. Moreover, "C plus good design" can also write very good things.

    For the language itself, C is a subset of C++, so what kind of subset is it? As can be seen from the above, C implements procedural control and other related functions in C++, while C in C++ (I call it "C+") is strengthened compared to the original C, introducing overloading, inline functions, exception handling, etc., and C++ expands the content of object-oriented design, such as classes, inheritance, virtual functions, templates, and package container classes.

    To improve a little further, in C++, data encapsulation and types are nothing new, and there are issues to consider, such as: the choice of object granularity, the design and inheritance of object interfaces, the use of composition and inheritance, and so on.

    So C++ contains a richer concept of "design" than C, but C is a self-consistent subset of C++, which also has powerful features and is also worth learning.

  2. Anonymous users2024-02-04

    C is closer to the bottom layer than C++.

  3. Anonymous users2024-02-03

    It won't be hard as long as you study it carefully.

    In general, the difference between C++ efficiency and C efficiency is between 5%. Therefore, in general, C++ can be used as an alternative to C.

    C++ is too complex to understand, making it difficult for humans to understand its semantics. To make matters worse, the C++ compilation system is affected by the complexity of C++, which is very difficult to write, and even the compiler that can be used has a large number of problems, most of which are difficult to detect.

    Due to their complexity, the correctness of complex C++ programs is quite difficult to guarantee. Defects such as not supporting multithreaded primitives have also been raised. But the fact that so many well-known people have raised so many flaws is a testament to the widespread use and success of C++.

    Due to its excessive complexity and contradiction with UNIX culture, C++ has been popularized by many famous people in the UNIX Linux space (such as Linus Torvalds, the father of Linux, and Eric S., the famous hacker).Raymond).

  4. Anonymous users2024-02-02

    It's hard because it's hard. In fact, the focus is on object-oriented understanding, and the grammatical structure of C++ is not difficult at all... You can take a look at the object-oriented books first, and just read a few more.

  5. Anonymous users2024-02-01

    If you want to have a good foundation in the C language, it will be easier, so learn the basics first.

  6. Anonymous users2024-01-31

    There is not much difference in syntax, but there is a world of difference in programming ideas.

    You can also write programs in C++ according to the style of C, but it just looks awkward.

    Similarly, you can also use C to encapsulate some structs and program them according to the object-oriented idea of C++, which is much more cumbersome than C++ writing.

  7. Anonymous users2024-01-30

    Upstairs has already said a lot, it is easy to learn C++ with C foundation, and it is not impossible to learn C++ directly.

  8. Anonymous users2024-01-29

    Upstairs is indeed detailed, C++ is an object-oriented language developed from C. If you want to learn, you can learn C++ directly

  9. Anonymous users2024-01-28

    There are many differences between C and C:

    1. A new program thinking, C language is process-oriented, and C is object-oriented.

    2. The C language has standard function libraries, which are loose, and just put the functions with the same function in a header file; C++ is very tightly integrated for most functions, especially the APIs in C++, which are not available in the C language, are an organic combination of most APIs in the window system, and are a collective. But you may also call the API separately.

    3. Especially the graphics processing in C++, which is very different from the graphics of the language. Graph processing functions in C are basically not available in C++. Graphics processing is not included in the C language standard.

    4. There is a concept of structure in C and C++, but in C language there are only member variables and no member methods, while in C++ structure it can have its own member variables and member functions. But in C, the members of the structure are public, and anyone who wants to access it can access it; In VC++, it is private without qualifiers.

    5. The organization of the program's files in C language is loose, and almost all of them have to be processed by the program; The organization of documents in C++ is based on engineering, and the classification of each document is clear.

    6. The IDE in C++ is very smart, and like VB, some functions may be stronger than VB.

    7. The C++ pair can automatically generate the program structure you want, so you can save a lot of time. There are many tools available, such as when adding classes in MFC, when adding variables, etc.

    8. There are also many additional tools in C++, which can be used for systematic analysis and can view APIs; You can view the controls.

    9. The debugging function is powerful, and the methods are diverse.

    The C language is process-oriented, while C is object-oriented.

  10. Anonymous users2024-01-27

    To learn C++, you'd better learn C first, and then learn some things in the class, basically you can master most of the content, and then learn some specifications, and that's it!

  11. Anonymous users2024-01-26

    It's not that hard to get acquainted, but it takes a lot of effort to become proficient.

  12. Anonymous users2024-01-25

    Someone once asked if the end of the world is far away, and Gu Long said: The end of the world is not far away? The end of the world is not far at all. Because man is already at the end of the earth. Is the end of the world still far away?

    This is the same as C++.

  13. Anonymous users2024-01-24

    C++ is comparatively more difficult than C, and it is an object-oriented programming language.

  14. Anonymous users2024-01-23

    Which is more difficult, C language or C++, and with C language knowledge, will it be easier to learn C++ again?

    C and C++ are both programming languages, but they differ in terms of syntax, semantics, and programming style. As a result, C++ can be more difficult to master than C. The C++ language adds many new features and concepts, such as classes, polymorphisms, templates, etc., which require more time and effort to learn and understand.

    However, if you've already learned C, learning C++ is a bit easier. This is because C++ is based on C, and many of the basic concepts and syntax of C are also applicable in C++. For example, variables, data types, functions, etc., all have similar concepts and usages in both C and C++.

    As a result, you can understand and learn C++ concepts and syntax faster on top of the C language. However, to become a proficient C++ programmer, it still takes a lot of time and effort to learn and practice. So, no matter what programming language you learn, continuous learning and practice is necessary.

  15. Anonymous users2024-01-22

    There is no such thing as a good or bad language, only a fit and a bad one.

    Learn C++ because C++ provides an implementation mechanism for many software engineering concepts and is more suitable for large-scale development, but C++ also has many widely criticized shortcomings; When it comes to learning, it's best to learn C++ after you've learned about data structures and even operating systems, otherwise it's hard to understand what classes really mean.

    Other mechanics of C++, such as generics, templates, inlines, etc., need to be slowly understood in actual development, and learning only allows you to know the basic concepts of these things.

    The biggest feature of C is its simplicity, so it is not suitable for development, but this does not affect the power of C.

    In short, C++ is excellent, and C is beautiful.

  16. Anonymous users2024-01-21

    C++ must understand classes and objects.

  17. Anonymous users2024-01-20

    The C++ language is an extension of the C language, and C++ is object-oriented. I think C++ is a little bit more interesting and practical, but I also find it difficult... However, if you learn patiently and practice more hands-on computer exercises, you will definitely learn well.

  18. Anonymous users2024-01-19

    I first looked at the database design before I looked at C++, and the logical design of the database was modeled in UML! It is recommended to understand the UML modeling language before learning C++!

Related questions
6 answers2024-02-08

Define the struct:

typedef struct _legaladdress_{ >>>More

10 answers2024-02-08

First of all, a Class C has 254 addresses but there is always one as a gateway route, so there can be a maximum of 253 hosts. Then these hosts are public IP addresses. It can be done by setting up a LAN and using one IP. >>>More

8 answers2024-02-08

I also have this under the C drive:

debug [02-20 main plugin created]: onconnectdebug [02-20 : new >>>More

18 answers2024-02-08

It is recommended not to replace, first of all, that your machine uses the KM400 chipset. He decides what kind of CPU you can use, and from the official website, the KM400 supports AMD K7 Athlon, XP Sempron, Athlon, and Duron processors. >>>More

16 answers2024-02-08

What is the root of suffering: 1. Ignorance The word "ignorance" is generally understood by people to mean lack of knowledge. In today's information age, the corresponding cultural knowledge is particularly important, as it is often said: >>>More