C Language Learning Notes---Introduction to 001C language, compiling process principles, tools, etc.

Source: Internet
Author: User

C Language Learning Notes---Introduction to 001C language, compiling process principles, tools, etc.


Technical QQ Exchange Group: dream:251572072
-----------------------------------------------------------------------
The history of the A.C language
Origin
Standardization
B. C-based language
Programming languages have borrowed from the characteristics of C language
C + + language: Includes all C language features, adds classes and other features to support object-oriented programming
Java: C + +-based, containing some of the features of C
C #: is developed by Java and C + +
Perl: scripting language
C.C Language Features:
C is a low-level language, in order to adapt to the needs of system programming, C provides a machine-class
Access to concepts that are hidden in other programming languages.
D.C language is a small language, compared with other programming languages, C language provides a more limited set of
, to a large extent, the C language relies on a standard library of functions in its program.
The e.c language is an inclusive language, and the C language assumes that the user knows what they are doing, so it provides a broader degree of freedom
---------------------------------
1. Advantages:
Efficient, portable, powerful, flexible, standard library
2. Cons: C program error more easily hidden
Difficult to understand, such as the kernel
C language is missing classes and packages, so the programming scale can not be very large, maintenance is inconvenient
----------------------------------------
3.4.3.4 C Language writing code
Correctly according to the specifications of the C language program, you can easily check the code of the program
Look, troubleshooting and maintenance. More organized.
<1> statements can be placed separately in any number of lines.
<2> spaces make it easier to differentiate.
<3> indentation helps to easily identify program nesting.
<4> empty lines can divide the program into logical units.
<5> hump naming style and underline distinguishing method.
--------------------------------------------------------------------
/* Note:your choice is C IDE */
#include "stdio.h"
The above is indispensable, contains the C language standard input and output related information
The program executable code is in the main function
void Main ()
{30*3; {7{}-3;} {}}
Curly braces have truncated properties
{7{}-3} in the middle of the curly braces, the 7 and 3 are divided into two segments
7 It's not right to have a semicolon behind.
{} contains content that is invisible to the outside and is one-way transparent
//-------------------------------------
1. Preprocessing: The command that starts with # in the program is a pre-processing command, which is performed by the preprocessor
A. Preprocessing is the first initialization process when the system starts
B. If the <> symbol is used after the # include <stdio.h> preprocessing, then the GCC compiler will automatically
Go to the directory of the system to find this file
If you use # include "Demo.h", GCC will go to the current directory to find this file
C. Preprocessing instructions to add the contents of other files to the current file
/* processing. Gcc-e
2. Compile: Compile the program into binary file, hello.o file, target file gcc-c
3. Link: The target code and other additional code are integrated by the connector
That's when the final executable program is available.
GCC hello.o When this is done, it generates a
Hello.out
4.GCC Compiler:
A.GCC is the most popular compiler for C language
B.GCC [Options][filenames]
5.GNU Compiler Collection (GCC)
MinGW (GCC tools under Windows System)
GCC tools on different computers may vary greatly
GCC provides tools on a 32-bit machine
The GCC also provides tools on a 64-bit machine.
The same program, after compiling on 32 and 64 bits, executes a different result.
6.
*/




int main{
return 0;
}
--------------------------------------------------------
4.4 Variables and assignments
4.1.4.1 Variables
Essentially, a variable is a memory space that is called a name, and when the variable is accessed
When you are hungry, you are actually accessing this memory space.
Type: Each variable must declare its type, and the type is used to illustrate
The type of data stored by the variable. The C language has many types, which can be divided into basic
This data type and composite data type.
The base data type contains a character (char) integer (int) floating-point (float).
Declaration: Any variable must be declared before it is used.
Assignment: A variable obtains a value by assigning a value. The variable is assigned to a value or its
He must make a declaration before using the method,
-----------------------------------------------------------
5. Types of annotations:
/* Note:your choice is C IDE */
#include "stdio.h"
void Main ()
{
1. Notes
Single-line Comment
/*
Multi-line comments
*/

}
-------------------------------------------------------
6. Specifically, the GCC compilation process:
A. Preprocessing: This phase is used to process all pre-processing instructions
B. Compiling: After preprocessing the code to translate work, obtains the computer to recognize the format, must
To the result file called the target file, the extension is. O.
It can be understood that all Web pages that are similar to a Web site have, but connected relationships
Not yet, know a Web page do not know, the next to jump to which file
C. Connect: Bar all the target files and other necessary files are merged together to get the final
Executable file
Can be understood as: To set up all the connections on the Web
-------------------------------------------------------------------
Common options for 7.GCC
-O is used to specify the name of the final generated executable file
-e preprocessing of source files only
GCC-E DEMO.C
After processing, the code changes,
The specific change is
#include pre-processing instructions are gone, the files specified by the preprocessing directives are included in the
-C is used to pre-process and compile only the source files
--------------------------------------------------------
Compilation criteria:
8.c Language History:
Standard for C language:
A. International organizations stipulate that two standards are established in different years
C89 standard----learned in school.
C99 standard----Some extensions to c89, some syntax is not supported in C89, but
C99 can support if, in C89, C99 syntax is used, an option is required to tell
GCC, compiled with C99 standard
Specify with the following command, C89,C99 standard
-std=c89/-std=c99 is used to specify the standard of the C language that the compilation follows
Compile with C89 standard when not specified
---------------------------------------------------------------------









C Language Learning Notes---Introduction to 001C language, compiling process principles, tools, etc.

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.