First,Registervariables keyword regiter requests the compiler to make the variables available to the CPU as much as possible in the register. Here are some points to note.
The register variable must be a type that can be accepted by the
function Function: hide operation details, structure more clear, reduce the difficulty of modification;4.1 Function Basics return value type function name (parameter declaration table) {Declaration and Statement} The order in which the function
Variable Storage types in C language are divided into: 1 static storage
It can be divided into external variables (extern) and static variables (static ).
(1) static variables
When the variable is defined, the storage unit is allocated and
C language variable type
AutoStaticExternalStatic externalRegister
Auto local variable
The auto variable uses the stack mode to occupy the storage space. Therefore, when this segment is executed, the system immediately allocates the storage space
The storage type of a variable determines when the scalar is created, when it is destroyed, and how long his value remains. There are three places where variables can be stored:Normal memory staticRun-time Stack autoHardware Register RegisterThe
0. Differences in definitions and declarations
1. What is definition?
the so-called definition is that the compiler creates an object, allocates a piece of memory to it, and gives it a name, which is what we often call variable
We have studied so many C language related knowledge before, in fact C language is gradually perfected in the process of practice. C language at the beginning of the design is to improve the B language, so that it can directly produce machine code,
Key words:C language Keywords 32:Keyword meaningAuto declares automatic variables, by default the compiler generally defaults to autoint declares an integral type variableDouble declares a dual-precision variableLong declares a variable of length
Last article looked at the development of c&&c++ language standards, this article then analyzes the embedded programming in the application of C + + language; in fact, based on the ARM processor, for C + + support is in place (using the gcc/g++
The definition of a variable
The variables in the C language must be defined at the location where the scope begins!! C + + More emphasis on the "practicality" of the language, all variables can be used when needed to redefine.
#include
C Language Notes (1), C Language notes
Joke:Programmer A: "Dude, I have been busy recently. Do you want to borrow some money ?"Programmer B: "How much is it ?"Programmer A: "One thousand rows ?"Programmer B: "Who are you talking! I'll give you an
C language knowledge Summary (4), C language knowledge Summary
Variable Scope
C language divides variables into local variables and global variables based on different variable scopes.
1. Local Variables
1> definition: a variable defined within a
three types of functions first: main function Mian () {} Second: User-defined function third: The C language provides the library function scanf ("%d;;; %d", &a,&b);//when the program is running, the first parameter must be entered with a three
Reprint: http://blog.sina.com.cn/s/blog_6a1837e90101128k.htmlRegister: This keyword requests the compiler to make the variables available in the CPU internal registers as much as possible, rather than through memory addressing, to improve efficiency
A joke:Programmer A: "Buddy, have you got a little money on hand recently?" ”Programmer B: "Come on, how much?" ”Programmer A: "1000 lines?" ”Programmer B: "Who and who we are!" Give you a whole, 1024, take it. ”========================= I'm a split
The storage period is the life cycle --the time that the variable is kept in memoryThe scope of the variable and the link together indicate which parts of the program can be used by the variable name.Note: Lifetimes and scopes are two different
01_C language basics, 01_c LanguageAbstract:
1. C language Overview2. Data Types, operators, and expressions3. C language program structure
4. VC6.0 exerciseKnowledge explanation 01: C Language History
1. Comparison between C language and other
1. Can a local variable be renamed with a global variable?
A: Yes. Global blocking will be performed in some cases. To use global variables, you must use "::"
A local variable can have the same name as a global variable. A local variable with the
C language keywords (1), C language keywords0. Differences between definitions and declarations
1. What is definition?
The so-called definition is that the compiler creates an object, allocates a piece of memory for this object and gives it
1. Mixed expression conversion: general principle: No DistortionTherefore, it is generally converted from narrow type to wide type.
2. Random Number: 0 to 10: A = rand () % 11Generate 1 to 10: A = 1 + rand () % 10
3. sizeof (type or variable) gets
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.