Current location - Music Encyclopedia - Chinese History - What is C language?
What is C language?
C language is a popular and widely used high-level programming language in the world.

C language is obviously superior to other high-level languages when it is used to operate operating systems, programs and hardware. Many large-scale applications are written in C language.

C language has strong drawing ability, portability and strong data processing ability, and is suitable for writing system software, three-dimensional and two-dimensional graphics and animation. It is a high-level language for numerical calculation.

Commonly used compiler software includes Microsoft Visual C++, Borland C++, Watcom C++, Borland C++ Builder, Borland C++3. 1 for DOS. Watcom c++11.0 for dos, GNU djgppc++, LCC win32 c compiler 3. 1, Microsoft c, high c, turbo c and so on. ......

The development history of C language

The development of C language is quite interesting. Its prototype ALGOL 60 language. (also called language)

1963, the University of Cambridge developed ALGOL 60 into CPL (Combined Programming Language).

1967, Matin Richards of Cambridge University simplified CPL language, so BCPL language was born.

1970, Ken Thompson of Bell Laboratories modified BCPL and gave it an interesting name "B Language". It means to boil the CPL language dry and extract the essence. He wrote the first UNIX operating system in B language.

1973, language b cooking. D.M.RITCHIE of Bell Laboratories finally designed a new language on the basis of B language. He took the second letter of BCPL as the name of this language, which is C language.

In order to popularize the UNIX operating system, Dennis M.Ritchie published a C language compiler "Portable C Language Compiler" in 1977.

1978 Brian W. kernigian and Dennis M.Ritchie published the C programming language, making C the most popular high-level programming language in the world.

From 65438 to 0988, with the increasing popularity of microcomputers, many C language versions appeared. Because there is no uniform standard, there are some inconsistencies between these C languages. In order to change this situation, American National Standards Institute (ANSI) has formulated a set of ANSI standards for C language, which has become the main feature of the current C language standard 3. C language. C language has developed rapidly and become one of the most popular languages, mainly because of its powerful functions. Many famous system softwares, such as DBASEⅲPLUS and dbase Ⅳ, are written in C language. With C language and some assembly language subroutines, the advantages of C language can be better brought into play, such as PC- DOS and WORDSTAR written in this way.

C language version

At present, the most popular C language is as follows:

Microsoft c or Microsoft c

Borland Turbo C or Turbo C

At&T Company. temperature coefficient

These C language versions not only realize the ANSI C standard, but also make some extensions on this basis to make it more convenient and perfect.

Object-oriented programming language

On the basis of C, Bjarne Strou-strup of Bell Laboratories introduced C++ in 1983. C++ further expands and perfects C language and becomes an object-oriented programming language. The latest popular C++ versions are Borland C++4.5, Symantec C++6. 1 and Microsoft VisualC++ 2.0. C++ put forward some deeper concepts. These object-oriented concepts supported by c++ can easily map the problem space directly to the program space, which provides programmers with a way of thinking and programming different from traditional structured programming. Therefore, it also increases the complexity of the whole language and is difficult to master.

Characteristics of c language

1. Concise, compact, flexible and convenient

C language has only 32 keywords and 9 control statements, and the program is written freely, mainly in lowercase letters. It combines the basic structure and sentences of high-level language with the practicality of low-level language. C language can manipulate bits, bytes and addresses like assembly language, which are the most basic working units of a computer.

2. Rich operators

C operators cover a wide range, including 34 operators. C language regards parentheses, assignment and cast as operators. Thus, C is extremely rich in operation types and diverse in expression types, and flexible use of various operators can achieve operations that are difficult to achieve in other high-level languages.

3. Rich data structure

The data types of C are integer, real, character, array, pointer, structure, common body type and so on. Can be used to realize various complex data types. The concept of pointer is introduced to improve the efficiency of the program. In addition, C language has powerful graphics functions and supports a variety of displays and drivers. And the calculation function and logical judgment function are powerful.

C is a structured language.

The notable feature of structured language is the separation of code and data, that is, all parts of the program are independent of each other except the necessary information exchange. This structured way can make the program clear and easy to use, maintain and debug. C language is provided to users in the form of functions, which can be easily called, and there are various loops and conditional statements to control the process of the program, thus making the program completely structured.

5.c syntax is not strict and programming freedom is great.

Generally, the grammar check of high-level languages is strict, and almost all grammatical errors can be detected. And C language gives programmers more freedom.

6.c language allows direct access to physical addresses and direct operation of hardware.

Therefore, it not only has the functions of high-level language, but also has many functions of low-level language. It can manipulate bits, bytes and addresses like assembly language, which are the most basic working units of computers and can be used to write system software.

7. The code generated by the C language program has high quality and high program execution efficiency.

Generally speaking, it is only 10へ20% less efficient than the object code generated by assembler.

8.c language has a wide range of applications and good portability.

One of the outstanding advantages of C language is that it is suitable for a variety of operating systems, such as DOS, UNIX, etc., and also for a variety of models.

Structural characteristics of c source program

The source program in 1.C language can be composed of one or more source files.

2. Each source file can be composed of one or more functions.

3. No matter how many files a source program consists of, it has one and only one main function, namely the main function.

4. There can be preprocessing commands in the source program (include command is just one of them), and the preprocessing commands should usually be placed in front of the source file or source program.

5. Every description and statement must end with a semicolon. However, preprocessing commands, function headers and curly braces "}" cannot be followed by a plus sign.

6. Identifiers and keywords must be separated by at least one space. If there are obvious separators, you can also stop adding spaces to separate them.

Rules to follow when writing programs

Of course, C language also has its own shortcomings, such as: the grammatical restrictions of C language are not strict, the types of variables are not strict, which affects the security of the program and does not check the subscripts of logarithmic families. From the application point of view, C language is more difficult to master than other advanced languages.

In a word, C language has the characteristics of both high-level language and assembly language. It is not only a successful system design language, but also a common programming language. It can be used not only to write applications independent of computer hardware, but also to write various system programs. Is a popular and widely used programming language.

C language has many advantages.

Pointer is a major feature of C language. It can be said that one of the important reasons why C language is superior to other high-level languages is that it can operate directly near the hardware, but the pointer operation of C also brings many unsafe factors to it. C++ has made a good improvement in this respect, which enhances the security while retaining the pointer operation. Java further improves security.

Disadvantages of c language

The shortcoming of C language is mainly manifested in the encapsulation of data, which makes C have great defects in data security, which is also a big difference between C and C++.