Role of the Static and Const keywords in C language, staticconst keywords
Local variables of the program exist in (stack), global variables exist in (static zone), and dynamic application data exist in (HEAP.
1. Act on variables:
Use static to
Non-original (the red letter in the text is your own opinion. If there is anything wrong, please kindly advise)
A program consists of commands and data. The same is true for a C program. When writing a program, developers often need to select
004-Process Control and type conversion, 004-process Conversion
Process Control
Sequential structure, selection structure, and cyclic structure
1. Ordered Structure
The program is executed sequentially by default.
2. Select a structure
If SELECT
Under the big project, we will encounter many source documents.Document a. cStatic int I; // only used in documentInt j; // used in the projectStatic void init () // only used in document{}Void callme () // used in the project{Static int sum;}The
Starting from the basic concepts and syntax, learning a language, especially now is a visual development, but I suggest not to drag several widgets first, instead, you must first understand the concepts, syntaxes, and specifications of the language.
The main content of this post refers to the C + + singleton model, in this case, for the original author's patient and meticulous analysis of the explanation, expressed thanks. This article will be combined with this article, give their own
ConceptArrays are widely used in program design and can be used to store large amounts of the same type of data in different types of arrays. There are generally three ways to create an array:An array of global/static ranges, an array of local
There is a alloc_null_binding function in the NAT module of Netfilter. This function will be called at the hook point local_in and when Nat is not initialized, in both cases, netfilter requires that SNAT can be executed in postrouting and local_in.
Auto static, register const volatile extern
(1) Auto
This keyword is used to declare that the lifetime of a variable is automatic, and variables not defined in any class, structure, enumeration, union, or function are considered global variables,
Detailed description of the role of static in C/C ++1. in C language, the literal meaning of static can easily lead us astray. In fact, it has three functions.(1) first introduce the first and most important one: hiding.When we compile multiple
Understanding the status and attributes of various variables in the program in the compilation and running stages is very beneficial for our development program. Through the discussion of the following examples, figuring out what information is
In the past few days, I have been studying TCP/IP sockets in C (2nd) Practical Guide for programmers and learning how to confirm that data transmission between the client and server is a piece of data begin and end, the author describes two methods:
From: http://blog.sina.com.cn/s/blog_4b9216f50100ean1.html
Auto
This keyword is used to declare that the lifetime of a variable is automatic, and variables not defined in any class, structure, enumeration, union, or function are considered global
The static function of C ++ has two usage methods: static in process-oriented programming and static in object-oriented programming. The former applies to common variables and functions, and does not involve classes. The latter mainly describes the
Six compilation Modes
Turbo C provides six compilation modes. The compilation mode is also called addressing mode or memory mode, because it processes the following six modes: tiny mode tiny, small mode small, compact, medium, large mode
Global Reference/local reference/weak global reference
Passing the object created from the Java Virtual Machine to the local C/C ++ code will produce reference. Based on the Java garbage collection mechanism, Java object garbage collection will not
Starting from the basic concepts and syntax, learning a language, especially now is a visual development, but I suggest not to drag several widgets first, instead, you must first understand the concepts, syntaxes, and specifications of the
I. numeric type
1. Representation of real constants: 3.5 (Double Precision), 3.5f (single precision), and 3.5l (Long Double Precision)
2. integer constant: a char character constant ('A', 'B', '0') used as an integer constant for calculation.
3.
_ Declspec is used to specify the Microsoft-related storage method for the specified type of instance. Other modifiers related to storage methods, such as static and extern, are ANSI norms in the C and C ++ languages, while _ declspec is a
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.