The beauty of programming, the rapid development of American science and Technology, the change of C language to America

Source: Internet
Author: User
Tags array length

Last July, I was fortunate enough to be invited by American friends to take a dip in the many high-tech companies that are booming in the United States. Originally, I thought that the United States only Google, Apple, FACEBOOK,IBM, Microsoft, Cisco, these giant high-tech enterprises in the world's new technology field active. But when it came to America, I really found that America was far more colorful than I had imagined. And let the United States high-tech industry to show the vitality of the factors, I deeply found that C language is really important.

C language is a general-purpose computer programming language, widely used in the development of the bottom. The C language is designed to compile and process low-level memory in an easy way, generating a small number of machine codes and programming languages that do not require any running environment support to run.

It is precisely because of the C language design ideas so that the American creative design ideas can be vividly demonstrated, high-tech intelligent control of a large number of new products can be embodied in the United States everywhere. On the July 6, I was fortunate enough to visit a 14-year-old American high school student (whose parents are small farmers, whose crops only cost a family), and whose companies have developed a particularly large number of transport-related applications for the United States, including road-troubleshooting machines and vehicle overloading tracking instruments, And the use of big data for shopping malls to serve supermarkets. Now that the middle school student is 26 years old, and my general year, when we communicate together, I can not learn from it how proud he is of all this, on the contrary, and he found that he has made all the results appear to be natural. He said he had learned C at the age of 8 and had been able to write drivers for robots at the age of 10. And all of his accomplishments now, in addition to the product's components from his extensive channels, all the machine control and operating procedures are derived from the C language provided by the basic programming.

I also visited a number of American companies specializing in measuring equipment and sewage treatment equipment company, the internal production of the original is from the C language.

I wonder why the C language has such a great magic?

At first,there was no official standard for C language. in 1978, the C language was formally published by the American Telephone and Telegraph Company (T) Bell Laboratory . Blaine Collingham (Brian Kernighan) and Dennis Ritchie (Dennis Ritchie) published a book called "TheC programming Language". The book was called K&r by C-language developers and has been used as an unofficial standard for the C language for many years. People call this version of C language k&r c. k&r C mainly introduces the following features:

struct (struct) type

A long integer (lengthint) type

unsigned integer (unsigned int) type

Change the operators =+ and =-to + = and -=. Because =+ and =-make the compiler unaware that the user is handling i = 10 or i =-10, the processing is confusing.

Even after many years since the ANSI C standard was introduced,K&r C is still the most accurate requirement for many compilers, and many older compilers still run the k&r C standard.

From the 1970 to the 80 's,C language was widely used, from mainframe to small microcomputer, also derived from the C language of many different versions.

In 1983, the American National Standards Association (ANSI) established a committee X3J11 to develop the C language standard.

In 1989, the American National Standards Association (ANSI) passed the C language standard, known as ANSI x3.159-1989 "Programming Language C". Because this standard is passed in 1989, so the general abbreviation C89 Standard. Some people are also referred to as ANSI C, because this standard is issued by the American National Standards Association (ANSI).

In 1990, ISOand the International Electrotechnical Commission (IEC) set the C89 Standard as an international standard for C, named ISO/IEC 9899:1990-programming Languages--C. Since this standard was released in 1990, some people put the abbreviation as C90 standard. But most people still call it the C89 standard, because this standard is exactly the same as the ANSI C89 standard.

In 1994, the International Organization for Standardization (ISO) andIEC issued a revised version of the C89 standard named ISO/IEC 9899:1990/cor 1:1994 [6], some referred to as the C94 standard.

In 1995, the International Organization for Standardization (ISO) andIEC issued a revised version of the C89 standard, named ISO/IEC 9899:1990/amd 1:1995-c Integrity [7], Some people are referred to as C95 standards.

C99 Standard

1999 January, the International Organization for Standardization (ISO) andIEC issued a new standard for the C language called ISO/IEC 9899:1999-programming languages- C [8], referred to as C99 standard. This is the second official standard of the C language.

The features included in the C99 are:

Added limitations to the compiler, such as that the source program requires at least 4095 bytes per line, and the variable name function name requires support to 63 bytes (extern requires support to 31). enhanced preprocessing capabilities. For example:

Macro supports variable parameters #define MACRO (...) __va_args__

When using macros, the omitted arguments are allowed, and the omitted arguments are expanded into empty strings. Support//single-line comment at the beginning (this feature is actually supported on many compilers of C89) Added new keywordsrestrict, inline, _complex, _imaginary, _boolSupportLong long, long double _complex, float _complex and other typesSupports an array of indefinite length, that is, the length of the array can be determined at run time, such as using variables as the array length. Use when declaringthe form of int a[var]. However, given efficiency and implementation, indefinite arrays cannot be used globally, or in structs and unions. Variable declarations do not have to be placed at the beginning of a statement blockThe For statement advocates the form of a for (int i=0;i<100;++i), where i is only valid within the FOR statement block. Allowed to use (type_name){xx,xx,xx} constructs an anonymous struct in the form of a C + + constructor. Compound literal: The initialization structure allows the assignment of a value to a specific element in the form of:struct Test{int a[3],b;} foo[] = {[0].A = {1}, [1].A = 2}; struct Test{int A, B, C, D;} foo = {. A = 1,. C = 3, 4,. b = 5};//3,4 is the value assigned to. c,.d. In the formatted string, use the\u Unicode-enabled characters. Support16 The description of the floating-point number in the binary. printf scanf's formatted string adds support for the long long int type. The internal data description of the floating-point number supports the new standard and can be used#pragma compiler directives are specified. In addition to the existing__line__ __file__, add __func__ to get the current function name. An expression that allows the compiler to simplify the number of very few. Modified the/% deals with the definition of negative numbers, which can give definite results, such as -22/7 =-3, 22% 7 =-1, or -22/7=-4, 22% 7 = 6 in C89. While C99 is explicitly -22/7 =-3, 22% 7 =-1, there is only one result. The function return type is canceled by defaultthe provisions of int. AllowThe last array defined by the struct does not specify its length, write [] (flexible array member). the Const const INT i is treated as a const int i. Added and modified some standard header files, such as defining bool <stdbool.h>, defines some standard-length int <inttypes.h>, defining the plural <complex.h>, defining the wide character < Wctype.h>, a mathematical function similar to generics <tgmath.h> floating-point related <fenv.h>. In <stdarg.h> added va_copy for copying ... The parameters. Added the

  Annotations in the form of/*...*/are only allowed in C89 , while C + + allows comments in//form, so comments in//form are called C + + styles. However , many C-compiler systems have supported this convenient annotation method before C99,C99 formally incorporate //form annotations into the C language standard. The input and output are supported for wide characters and long integers.

GCC and some other commercial compilers basically support most of C99 's features.

C11 Standard

2011 December 8th, the International Organization for Standardization (ISO) andIEC issued a new standard for the C language called ISO/ IEC 9899:2011-information Technology--programming languages--C [10], referred to as C11 Standard, formerly known as C1x. This is the third official standard in C and the latest standard for C language.

The new standard improves the compatibility of C + + and adds some new features. These new features include:

Normalization of Alignment (Alignment) (including _alignas markers,alignof operators , Aligned_alloc functions, and <stdalign.h> Header file.

_noreturn function tag, similar to GCC's __attribute__ ((noreturn)). _generic keyword.

Multithreading (multithreading) support, including:

_thread_local storage type identifier, <threads.h> header file, which contains thread creation and management functions. _atomic type modifier and <stdatomic.h> header file. Enhanced unicode support. Based on the c Unicode Technical Report iso/iec TR 19,769:2004, enhanced support for unicode. Included for utf-16/utf-32 encoding added char16_t and char32_t data types, providing a unicode string conversion function header file <uchar.h>. removed the gets () function, using a new, more secure function gets_s () substitution. The adds a boundary check function interface that defines new security functions such as strcat_s (), and so on. The adds more floating-point processing macros. anonymous struct /Consortium support. This in gcc already exist, c11 to introduce it to the standard.

Static assertions (static assertions),_static_assert (), are processed after interpretation #if and #error. new fopen () mode,("... x "). o_creat| similar to POSIX O_EXCL, which is more commonly used in file locks. added the Quick_exit () function as the third way to terminate the program. When exit () fails, you can do the least cleanup work.

Through these, we can find that the United States together to achieve the original C language design goals to work together to create the current rise of American science and Technology, the U.S. in the world's copyright status to shape the opportunity. The time is late, everybody good night!

The beauty of programming, the rapid development of American science and Technology, the change of C language to America

Related Article

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.