Joke Collection Website - Joke collection - Which one is more powerful, C# or C? Why?
Which one is more powerful, C# or C? Why?
. . .
In terms of power, they are all general-purpose high-level programming languages ??and are very powerful.
The problem has no solution.
Here is a feature comparison (C, C#, C):
C language was born very early. The goal of C language is to be more convenient and easier to use than assembly, without losing the compilation expressive ability. Therefore, C language can be regarded as a "high-level assembly" language. C language source code can basically correspond to assembly code very easily, and no runtime environment support is required. The characteristics of C are simple and easy to compile, flexible and close to the bottom layer. So until now, some software that needs to deal directly with hardware is still written in C language. In short, C language is simple to write, closer to the bottom layer, and manages data storage intuitively.
The C# language has a high abstraction level and basically only one type (object-oriented). It has rich runtime support (garbage collection, etc.) and rich class libraries. So it is easy to learn and easy to use, while taking into account operating efficiency and optimizing as much as possible. C# is similar to Java. What you get after compilation is not machine code, but meta-instructions running in the virtual machine. It pays more attention to security. It has no pointers, cannot directly operate the memory, and automatically implements memory management.
The most intuitive difference is: C# does not have a pointer type, and the memory is automatically managed; C# has a string type, but the C language does not, relying on character arrays or pointers to store strings; in C#, switch can be followed by the string type , and will prohibit the failure of all switch..case statements. Unless there is a space after the case statement, otherwise the execution of the previous case statement will stop executing the following case statement even if there is no break;
Definition in C# When using an array, the length of the array can be a variable, but when defined in C language, the length of the array can only be a constant expression. Dynamic allocation of memory requires the use of the molla function; there is no collection type in C language; C# has foreach that can be used for arrays and collections. Traversal, etc...
In general, the C language is lower level, and many things require DIY, but it is extremely flexible and powerful. Its essence lies in pointers, direct management of data storage, and process-oriented programming. , many operating systems and system software are written in C language; C# is easier to get started, many things have been written and can be used directly, avoiding direct management of memory and object-oriented programming; as a cold joke says : "C language: pointers are best to use.
C: It is best not to use pointers. C#: What are pointers?"
Good articles should be liked
Follow me
Bookmark this article
- Previous article:Reasons against delaying retirement
- Next article:What is the story and moral of three people becoming a tiger?
- Related articles
- Analysis of Hell Jokes
- Funny jokes about staying up late in WeChat Moments (selected 40 sentences)
- How does an interesting soul answer the next sentence funny?
- The ultimate joke about the chaos of time and space
- Yueshi Fengyin lipstick has the same shelf life as other lipsticks.
- Which university did ZhangZetian graduate from?
- In the following conversation, what does simple low-level development mean? Can you provide a few websites he mentioned? I am a software engineering major! I am a sophomore! Thank you! gt;.lt;
- How to find hot spots, sectors and bull stocks in the stock market?
- What should a woman do when she is in a bad mood?
- How to write the semi-propositional composition "My ()" is urgent! ! ! ! ! ! ! !