Turn from: https://www.cnblogs.com/hanyonglu/archive/2011/04/12/2014212.html make slight changesThis article describes the heap, stack, and static data areas in C + +. five large memory partitionsIn C + +, memory is divided into 5 extents, namely
1. The first and most important article is to introduce it: hide. (static function, static variable all available)When multiple files are compiled at the same time, all global variables and functions that do not have a static prefix have global
1. First and foremost, the first and most important one: hide. (static function, static variable all can)When you compile multiple files at the same time, all global variables and functions that have no static prefix are globally visible.For example,
1. Start by introducing itsThe first and most important article://Global variablevoid msg () {printf ( "hello\n "//main.c int main () {extern char A; // extern variable must be declared before use printf ( "%c " , a); (void) msg (); return 0
Protectedto talk about the protected access rights issue. Look at example 1 below:Test.java
Class MyObject {} public
class Test {public
static void Main (string[] args) {
MyObject obj = new MyObject (); C5/>obj.clone (); Compile
1. The first and most important article is to introduce it: hide . (static function, static variable all available)When multiple files are compiled at the same time, all global variables and functions that do not have a static prefix have global
Rx tries to avoid state leaks to scenarios outside of the data stream. But some things have their own state. For example, the server can be online and offline, the phone can access WiFi, button was pressed and so on. In Rx China, we see these events
1. Static
(1) first introduce the first and most important one: hiding.
When we compile multiple files at the same time, all global variables and functions without the static prefix are globally visible. I will give an example to illustrate this
Array can be initialized, that is, when it is defined, it contains the values that can be used immediately by the program.
For example, the following code defines a Global Array and initializes it with a set of Fibonacci numbers:
Int iarray [10] = {,
The serializable class does not declare a static final serialversionuid field of type long warning appears when compiling the following Java program1 Packagelearn;2 3 Importjavax.swing.*;4 Importjava.awt.*;5 Importjava.awt.event.*;6 7 Public
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.