What are the characteristics of C language?

Source: Internet
Author: User

C language is often referred to as intermediate computer language. Intermediate language is not derogatory, does not mean that it is poor in function, difficult to use, or than B a S I C, P a s c a l, such as the original high-level language, it does not mean that it is similar to assembly language, will bring similar trouble to users. C language is called intermediate language, because it combines the components of high-level language with the function of assembly language.

As an intermediate language, C allows manipulation of the basic components of bits, bytes, and addresses in these computer functions. C language programs are very easy to transplant. Portability means that software written for some kind of computer can be used on another machine. For example, if a program written for an Apple can be easily changed to a program that can be run on an IBM PC, it is called portable.

All high-level languages support the concept of data types. A data type defines a range of values for a variable and a set of operations on which it can be manipulated. Common data types are integer, character, and real. Although the C language has five basic data types, it is not a strongly typed language compared to p a s c a l or a D a. The C program allows for almost all types of conversions. For example, character and integer data can be freely mixed in most expressions. This is not allowed in strongly typed high-level languages.

Another important feature of the C language is that it has only 3 2 keywords, which are the commands that make up the C language. Compared to the B A S I C of an IBM PC, the latter contains more than 1 5 9 keywords.

C language is a structured language

Although from a strict academic point of view, C language is a block structure (b l o C k-s t r u c t u r e D) language, but it is often referred to as a structured language. This is because it is structurally similar to a l G o L, P a s C a l, and M O d u l a-2 (technically, block-structured languages allow procedures or functions to be defined in procedures and functions.) In this way, global and local concepts can be extended by scope rules, and scope manages the visibility of variables and procedures. Because C does not allow a function to be defined in a function, it cannot be called a block-structured language in the usual sense.

The salient feature of structured language is the separation of code and data. This language can separate and hide the instructions and data that perform a particular task from the rest of the program. One way to get quarantined is to call a subroutine that uses a local (temporary) variable. By using local variables, we can write subroutines that have no side effects on other parts of the program. This makes it very easy to write programs that share code snippets. If you develop some well-separated functions, we just need to know what the function does and not know how to do it when referencing. Remember: Excessive use of global variables (variables that can be accessed by all programs) can introduce errors into your program due to unintended side effects.

Structured languages are easier to program than unstructured languages, and the clarity of programs written in structured languages makes them easier to maintain. This is a widely accepted view of the population.

The main structural component of C language is the Independent subroutine of function C.

In C language, a function is a component (a program block), which is the basic component to complete the function of a program. Functions allow the tasks of a program to be individually defined and coded to make the program modular. You can be sure that a good function works correctly and does not have side effects on other parts of the program.

C language is the language of the programmer

Perhaps you would ask, "are all computer languages not programmers?" "The answer is decidedly" no ". We consider the typical non-programmer language c o B o l and b A S I C. The design of C o B o L makes it difficult for programmers to change the reliability of the code they write, or even to improve the speed of code writing.

However, the design of C o B o L is intended to enable non-programmers to read the program (which is unlikely). Note that this is not the advantage of attacking C o B o L, but rather that it is not designed to be the ideal language for programmers. The primary purpose of BASIC is to allow non-professional programmers to program on a computer to solve relatively simple problems. In stark contrast to the C language, because program generation, modification, and field testing are performed by real programmers from start to finish, it implements the programmer's expectations: few constraints, few forcing, block structure, independent functions, and a compact set of keywords. Programming in C allows programmers to obtain efficient machine code that is nearly as efficient as assembly language code.

Another reason the C language is widely used by programmers is that it can be used instead of assembly language. Assembly instructions used in assembler are symbolic representations of binary machine codes that can be executed directly on a computer. Each operation of assembly language corresponds to a single instruction executed by the computer. While assembly language gives programmers the potential to achieve maximum flexibility and maximum efficiency, the difficulty of developing and debugging assembly-language programs is unbearable. Non-structural makes assembly language programs difficult to read, improve and maintain. Perhaps more importantly, assembly language programs cannot be ported between machines that use different C P U.

Initially, the C language was used for System program design. A "System program" is part of a large class of programs that make up the computer's operating system and utility programs. Commonly referred to as System programs are:

Operating system

• Translation procedures.

• Edit the program.

• Assembler program.

• Compile the program.

• Database management program.

With the popularity of C language, coupled with its portability and efficiency, many programmers use it to design various programs. Almost all computers have a C language compiler, which allows us to compile and execute the C language source program written for one machine on a different machine with little or no change. Portability saves time and money.

C language not only has its advantages in terms of speed and structure, but each C language system provides a special library of functions, programmers can tailor the different needs to adapt to the design of various programs. Because it allows (and more accurately encourages) compilation separately, the C language allows programmers to easily manage large projects and minimize duplication of effort.

What are the characteristics of C language?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.