[C Language] 01-c language Overview

Source: Internet
Author: User

Note:This C language topic is a prelude to learning iOS development. In order to allow users with experience in object-oriented language developmentProgramWho can quickly get started with the C language. If you have no programming experience or are not interested in C and iOS development, ignore

Why do IOS developers need to learn C language first?

Objective-C is the core language for iOS development. Objective-C adds an object-oriented syntax to the basics of C. To better master objective-C, we can first learn the C language and then sublimate it to objective-c Based on the C language. Of course, you can also directly learn objective-C, but I personally suggest learning C language first, then objective-C, and finally iOS development. This will be better.

 

I. A Brief History of C Language
    • C language was invented in 1972. It was used for the first time to rewrite the Uinx Operating System (Unix was previously compiled by sink)
    • With the success of the UNIX operating system, the C language has been greatly promoted. So far, it is one of the most popular and widely used advanced programming languages in the world.
    • C language isProcess-orientedLanguage, non-object-oriented language

The following is from February March 2013.Programming LanguageTop rankings

Since the birth of C language, its popularity has never been reduced. The first two are basically Java and C

 

Ii. Features of C Language 1. Rich Operators

Computing is the basic function of a computer. Therefore, the computing capability of a programming language is very important. The C language provides 34 types of operators, including addition, subtraction, multiplication, division, and many other types of operators.

2. Rich Data Types

A large part of how powerful the C language is because it has a wealth of data types. Data Types in C language: INTEGER (INT), float, Char, array (INT []), void *), struct type (struct), shared body type (union), etc. Among the many data types, the most powerful is the pointer, through which we can directly access the memory address. If the pointer is used properly, it not only savesCodeYou can also optimize memory management and improve performance. Therefore, pointers are a very important concept and must be emphasized. If you say that the C language has good knowledge except pointers, you should simply say that you have never learned the C language. Because of the rich data types and powerful computing capabilities of C language, many databases are written in C language, such as DB2 and Oracle.

3. Allow direct access to the physical address to operate the hardware

Because the C language allows direct access to the physical address, you can directly operate on the hardware. Therefore, it provides both advanced language functions and many low-level language functions, it can operate on bits, byte, and address like assembly languages, and these three are the most basic work units of computers.

4. Efficient target code

Compared with the assembly language, the C language is readable and easy to debug, modify, and transplant. The code quality is equivalent to that of the assembly language.

5. Good portability

A program written in C language in one environment can be transplanted to another completely different environment without modification or slight modification.

 

All of the above are advantages of the C language, but it must have disadvantages:

    • Since C language is process-oriented, it has poor data encapsulation and low security. This is one of the differences between C language and other object-oriented languages. One of the features of object-oriented language is Data encapsulation.
    • The syntax restrictions are not strict, the type constraints on variables are not strict, and the array subscript is not checked out.

 

Iii. What can c do?
    • C language has powerful data processing capabilities and allows direct access to physical addresses and direct hardware operations. Therefore, it is suitable for compiling system software, graphic processing, single chip microcomputer programs, embedded system development, and even for scientific research.
    • Many operating systems are written in C language at the underlying layer, such as Android
    •  Objective-C (OC) is the core language in iOS development. OC adds an object-oriented syntax based on the C language.

 

IV. C language version Problems

Since the success of the UNIX operating system, the C language has been widely used. From Large hosts to small computers, C language is active, and many versions of C language are also derived. In the past, C language may become a loose language with multiple variants. A formal language must have a standard. Otherwise, it will be messy. To change this situation, the American National Standards Institute (ANSI) established a committee in 1983 to begin the development of C language standards. The C language standard was approved in 1989. The C language standard of this version is usually called ANSI C

 

V. C language syntax Preview

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.