One-month training of Zhongxing Software Park (i.)

Source: Internet
Author: User

At the end of the semester, the annual corporate training experience begins.

In fact, it is now nearing the end, just to learn the things to tidy up, for you June chat to see.

/********** This is the first day of the note *************************/

/*
One: The structure of the program
Project SLn
File. c files include: definition of function definition variables
The. h file includes: a definition macro definition that holds the claim type

Function:
Main function
Child functions
Statement
The word alphanumeric underscore cannot begin with a number
Two:
Data Type--->size range
Classification:
1. Basic types
Shaping signed unsigned
Real type
Character type: unsigned char [full 0~~~ full 1]
char [~~~0+ full 1] 1 0000000 When you see this, 1 is considered a sign bit and a digital bit.
Special attention here when overflow: (when overflow is the first 1 as the symbol and number)


Constants: A pair of single quotes called character constants ' 1 '
short int b = 0; 2byte-2^15~~2^15-1
int c = 0; 4byte-2^31~~2^31-1
Long d = 0; 4byte-2^31~~2^31-1
Long Long LL = 0;8byte-2^63~~2^63-1

unsigned short int usi = 0u;2byte (0~~2^16-1)
unsigned int ui = 0U; 4Byte (0~~2^32-1)
unsigned long int uil = 0ul;4byte (0~~2^32-1)
unsigned long long int ulli = 0; 8Byte (0~~2^64-1)

float F = 0.F; 4Byte
Double d = 0; 8Byte
Long double ld = 0; 8Byte

2. Construction type
Structural body
Community structure
Pointer type
Empty type void
Two: Solid and variable
2_1
1, the size of the variable to occupy memory memory is determined by the "data type"
2, the variable memory is a name, the name is the variable name
3. Variable memory is readable and writable
2_2
1, solid is also to occupy memory, the size of the memory is determined by the data type
2, solid memory is read-only, can not write
3. Solid string is a character enclosed in double quotation marks.
However: the "\0china" length is 0 but occupies 7 bytes of memory
Length of string: Count from left to right, encounter first '% ' cutoff
Size of the string: The number of bytes occupied by the string
"China" 5 lengths of 6 bytes
"\0usa" 0 lengths of 5 bytes
4. A character ' a ' ' B ' caused by a single quotation mark in the word Fuchangliang
Category: ' \ n ' \ t ' character escapes
' \ddd ' \xff ' numeric escape
Small details: ' \ddd ' (0~~~377) will not be \777 has exceeded
' FF ' (\X0~~~\XFF)
"\012345abc" occupies 8 bytes
Length is 7
"\378" has exceeded so 3/2 x
\X0ABCD = \x0a b c D
Three: Functions
Scope: The use range of the name
The same identifier cannot appear within the same scope
Names can only be used within scopes
The scope uses the nearest principle
Classification of scopes
1. File scope
2. Function scope
3. Statement block scope
int g_count = 0; The meaning of global
int g_foo = 0;

ncount = 0;
Nfir = 0;
3_4 Scope Extension
Only names within the scope of a file cannot be extended outside the scope of the name
Local scope cannot be extended

Static variables determine execution at compile time

3_5 recursively calls itself to call itself
To write a terminating condition, the termination condition is placed before recursion.
Recursion often opens up memory and affects efficiency

The 3_6 string holds the first-letter address, regardless of whether it is a parameter or a variable
Char str[] = "I love You";//Two strings, one in the array with a different address in the normal light
Char *p = "You Love Me";//Read Only, not writable

One-month training of Zhongxing Software Park (i.)

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.