"C Language" 01-c language overview

Source: Internet
Author: User

directory of this document
    • Why does iOS development need to learn C language first?
    • A brief history of C language
    • Ii. features of the C language
    • What can the C language do?
    • Iv. version issues in the C language
    • C language Syntax preview

Description: This C language topic is the prelude to learning iOS development. And for programmers with an object-oriented language development experience, you can quickly get started with C language. If you don't have programming experience, or are not interested in C or iOS development, please ignore

Back to top why should iOS develop a C language first?

The core language of iOS development is that objective-c,objective-c is a layer of object-oriented syntax based on the C language. In order to have a better grasp of objective-c, we can learn C language first and then sublimate to objective-c on the basis of C language. Of course, you can also directly learn objective-c, but I personally suggest to learn C language, then learn objective-c, finally learning iOS development, so the effect will be better.

Back to the top a brief history of C language
    • The C language was invented in 1972 and was first used to rewrite the Uinx operating system (Unix was previously written with sinks)
    • With the success of Unix operating system, C language has also been greatly promoted, is still the world's most popular, the most widely used high-level programming language One
    • C language is a process-oriented language, non-object-oriented language

The following is the March 2013 popular leaderboard for programming languages

Since the birth of C language, its heat has not been reduced, the top two are basically Java and C

Go back to the top second, C language features 1. Rich operators

The basic function of a computer is computing, so the computational power of a programming language is very important. The C language provides 34 operators, the type of calculation and its richness, including the most basic subtraction operations.

2. Rich data types

The reason why C language is so powerful is that it has a large part of it because it has a rich data type. The data types for C are: integer (int), real (float), character (char), array type (int []), pointer type (void *), struct type (struct), Common body type (union), and so on. The most powerful of the many data types is the pointer, through which we can directly access the memory address. By using pointers properly, you can not only save code, but also optimize memory management and improve performance. Therefore, pointers are a very important concept that must be valued. If you say that the C language except the pointer, others have learned very well, then you simply say you have not learned C language. Because the C language data type is rich, the computing ability is very strong, so many databases are written in C language, such as DB2, Oracle and so on.

3. allows direct access to physical addresses to operate on hardware

Since the C language allows direct access to physical addresses, it can operate directly on the hardware, so it has both high-level language capabilities and many features of low-level languages, capable of manipulating bits, bytes, and addresses like assembly language, which are the most basic unit of work for a computer.

4. High-efficiency target code

Compared with assembly language, C language readability is good, easy to debug, modify and transplant, code quality and assembly language equivalent.

5. Good portability

Programs written in the C language in one environment can be migrated to another completely different environment without modification or modification.

All of the above is a C-language advantage, but it must be flawed:

    • Because C language is process-oriented, its data encapsulation is poor, security is low, this is the C language and other object-oriented language of one of the differences. One of the characteristics of object-oriented language is the encapsulation of data
    • The grammatical restriction is not strict, the type constraint of the variable is not strict, and the subscript of the array is not checked.

Back to top three, C language can do?
    • Because the C language has the powerful data processing ability, and allows direct access to the physical address, directly to the hardware operation, it is suitable for writing system software, graphics processing, microcontroller program, embedded system development and even for scientific research
    • Many of the underlying operating systems are written in C, such as Android
    • The core language in iOS development is objective-c (OC), where OC adds a layer of object-oriented syntax based on the C language.

Back to top four, C language version issues

Since the success of UNIX operating system, C language has been widely used, from large mainframe to small microcomputer, have C language active figure, also derived a lot of versions of C language. In the long run, C language will probably become a multi-variant, loose language. A formal language, must have a standard to do, otherwise it will be out of order. In order to change this situation, the United States National Standards Bureau (American Nation Standards Institute, abbreviated as ANSI) set up a committee to begin work on the C language standard. 1989 C language Standard is approved, this version of the C language standard is commonly referred to as ANSI C

Back to top five, C language Syntax preview

"C Language" 01-c language overview

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.