Introduction to C language

Source: Internet
Author: User

C language is a universal, process-oriented computer programming language.

C is a general-purpose, high-level language originally designed by Dennis Ritchie to develop UNIX operating systems at Bell Labs. The C language was first implemented on the DEC PDP-11 computer in 1972.

In 1978, Blaine Collingham (Brian Kernighan) and Dennis Ritchie (Dennis Ritchie) made the first publicly available description of C, now known as the K&r standard.

Unix operating systems, C compilers, and almost all UNIX applications are written in C. for various reasons, C language has now become a widely used professional language.

C is a widely used computer language that is as popular as the Java programming language, and is widely used by modern software programmers.

The current up-to-date C language standard for C11, before it the C language standard for C99.

The C language test is usually used in computer grade exams.

Eg: "Hello world"

1 #include <stdio.h>2  3int  main ()4{5      /**     /6 printf ("Hello, world! \ n"); 7  8     return 0 ; 9 }

Instance parsing:

    • All C language programs need to include the main () function. The code executes from the main () function.
    • / * * * for Multiline comment description,//For single line comment.
    • printf () is used to format the output to the screen. The printf () function is declared in the "stdio.h" header file.
    • stdio.h is a header file (standard input Output header file), #include is a preprocessing command used to introduce a header file. When the compiler encounters the printf () function, a compilation error occurs if the stdio.h header file is not found.
    • return 0; Statement is used to indicate exiting a program.

The advantages of the C language:

    • Easy to learn.
    • Structured language.
    • It produces high-efficiency programs.
    • It can handle the underlying activity.
    • It can be compiled on a variety of computer platforms.

About C

    • The C language was invented to write UNIX operating systems.
    • The C language is based on the B language, and B is probably introduced in 1970.
    • The C language standard was established in 1988 by the American National Standards Association (ANSI, full name American Nation standard Institute).
    • As of 1973, the UNIX operating system was fully written in C language.
    • At present, C language is the most widely used system programming language.
    • Most of the advanced software is implemented using the C language.
    • Today's most popular Linux operating systems and RDBMS (relational database Management system: relational databases Management systems) MySQL are written in C language.
Why use C?

The C language was originally used for system development work, especially the program that composed the operating system. Since the code produced by C is running at the same speed as the code written in assembly language, C language is used as the system development language. Here are a few examples of using C:

    • Operating system
    • Language compilers
    • Assembler Series
    • Text Editor
    • Printer
    • Network Drive
    • Modern programs
    • Database
    • Language interpreter
    • Entity Tools
C Program

A C language program, which can be 3 rows or millions of lines, which can be written in one or more text files with the extension ". C" , for example,hello.c. You can use "VI","vim" or any other text editor to write your C language program.

C11

C11 (also known as C1X) means ISO standard ISO/IEC 9,899:2011 and is currently the latest C language standard. The C language standard before it is C99.

New features
      • Alignment (Alignment) normalization (including _alignas, alignof operators, Aligned_alloc functions, and <stdalign.h> header files). The

      • _noreturn function tag, similar to GCC's __attribute__ ((Noreturn)). The

      • _generic keyword.

      • Multithreading (multithreading) support, including:
        _thread_local storage type identifier,<threads.h> header file, which contains the thread creation and management functions. The
        _atomic type modifier and the <stdatomic.h> header file. Support for enhanced Unicode for

      • . Enhanced support for Unicode, based on the C Unicode Technology report, ISO/IEC TR 19,769:2004. Includes the addition of char16_t and char32_t data types for utf-16/utf-32 encoding, and a header file <uchar.h> that contains a Unicode string conversion function.

      • Removes the gets () function and replaces it with a new, more secure function, gets_s (). The

      • Adds a boundary check function interface that defines new security functions such as fopen_s (), strcat_s (), and so on.

      • Adds more floating-point processing macros (macros).

      • Anonymous struct/consortium support. This has already existed in GCC and C11 it into the standard. The

      • Static assertion (static assertions), _static_assert (), is processed after the interpretation #if and #error.

      • New fopen () mode, ("... x"). o_creat| similar to POSIX O_EXCL, which is more commonly used in file locks.

      • Adds the Quick_exit () function as the third way to terminate the program. When exit () fails, you can do the least cleanup work.

Introduction to 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.