Happy start-HelloWorld, start-helloworld

Source: Internet
Author: User
Tags custom name

Happy start-HelloWorld, start-helloworld
1 include header file inclusion

Include is to tell the compiler that it contains a header file,

In C, any library function call must include the header file in advance.

<Header file>: allows the C language compiler to search for relevant header files in the system directory.

"Header file" indicates that the C language compiler is used to search for relevant header files in the current directory.

If you use a header file required by the C language library function, it must be # include <>

If a custom hfile is used, it must be # include ""

2 main Function

The main function is the main function in C language. a c-language program must have one main function and only one main function.

3. Notes

// A single line comment represents a comment, which is a text description with no substantive significance. A single line comment is a Comment Method in the C ++ language.

/**/, Multi-line comment, multi-line comment is a standard C language Comment Method

4 {} brackets, program questions and code blocks

The Code of all functions in C language is included in {}.

5 Statement

Int;

Declare a variable named a. For C language, the variable name can be defined in sub-statements.

6 C language custom name requirements

Uppercase/lowercase letters, underscores, and numbers are supported, but the first letter must be a letter or underscore.

Uppercase/lowercase letters

The keyword in C language cannot be used as the variable name.

Each line must be; End

7 printf Functions

Printf outputs strings to the standard output device.

If you want to output a string :. For example: printf ("hello world ");

If you want to output an integer, for example, printf ("% d", integer)

Printf ("\ n"); A line break will be output

8 return Statement

A function terminates when it encounters a return statement. return is a keyword of C language.

9 System call

The function of the System library function is to execute operating system commands or run specified programs. To call the System library function, you must include <stdlib. h>

9.1 System return values are different in windows and unix 9.2 POSIX

Specifications and standards

10 C language compilation process. Introduction to gcc parameters 10.1 C language compilation process

 

10.2-E pre-Compilation

Gcc-E-o a. e a. c

Pre-compile the. c file. The generated target file name is a.e.

Pre-compilation replaces the header file content contained in include with the C file, and deletes unused comments in the code.

10.3-S Assembly

-S is to convert the C language to the assembly language,

10.4-c Compilation

Machine commands that compile code into binary

10.5 Link

Gcc does not have any parameters, which means it is a link.

11 Operating System Structure

11.1 User Mode

Applications are running in the user region.

11.2 Kernel Mode

The operating system kernel and device drivers run in kernel mode.

12 64-bit, 32-bit system differences 12.1 internal CPU Structure and registers

 

12.2 CPU architecture of Proteus and CISC

Reduced Instruction Set of the Proteus

CISC complex commands. Generally, CPUs in the x86 architecture are complex commands. AMD and intel are x86 architectures. linux is an x86 operating system.

12.3

Sun has its own CPU, which is a SPARTC-based CPU.

13 Assembly Language 13.1 I386 Assembly Introduction

Mov eax, 10

Add eax, 10

Sub eax, 20

Call printf

13.2 VS Disassembly

F9 first sets a breakpoint

F5, run the code in debugging mode

14 IDE tool 14.1 common QT Shortcut Keys 14.2 VS common Shortcut Keys 14.3 VS breakpoint, debugging

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.