Basics of C-language learning before you start-1

Source: Internet
Author: User
Tags bitwise operators

C Language Overview

Welcome to the world of C! C was named C because the C language originated from the B language invented by Ken Thompson. It is a portable language, usually a C program can be very little change or even can run on other systems, it is powerful and flexible, most of the UNIX operating system is written in the C language, it is even used to create special effects for movies, it also allows programmers to access hardware and manipulate specific bits in memory , which also brings many dangerous and hard-to-follow programming errors ...


In the past 30 years, C has become one of the most important and popular programming languages. Until today, the C language has maintained a strong momentum. If you want to go into the world of programs, C is undoubtedly a must. What are you waiting for, now embark on your C-language tour!

Before we learn the C language, we need to understand some of the knowledge of C and the computer.

Bits, Bytes, and words

Bits, Bytes, and words are used to describe the computer's storage unit.
The smallest storage unit is called a bit, which can hold one of two values (0 or 1). is the basic unit of computer storage.
BYTE (byte) is a common storage unit for a computer. For most machines, 1 bytes are 8 bits, because each bit is 0 or 1, so a byte contains 256 possible combinations of 0 and 1. We will learn the binary encoding in the "bitwise Operators" later.
For a given computer design, word (word) is a natural storage unit. The early IBM compatible machine was a 16-bit machine, meaning a word size of 16 bits. The word in the Pentium-based PC is 32 bits. A more powerful computer can have 64-bit or longer-digit words.

Good programming habits

Have good programming habits to write a readable program. A readable program is easier to understand, correct, and modify. The use of annotations mentioned earlier is a technique for improving readability.

Also, each statement is placed on one line, and the statements between the modules are aligned. The C language does not require you to do this, you can put multiple statements on one line or put a statement on multiple lines, but doing so will make your program look bad, and greatly reduce readability.

More learning content, just in the code bud Net Http://www.mayacoder.com/lesson/index

Let's look at a compilation example:

Basics of C-language learning before you start-1

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.