The combination of Const and Volatile in the BCB is also available. . .

zhaozj2021-02-16  50

1. Const is static modifications for variables.

When Volatle and Const are used together:

Very people may not be familiar with Volatle, which means that a variable and object can not only change the night by the program code, but also changed by the hardware or operating system, other running threads.

Const volatle unsinged int * recher = (const unsige INT *) 1234;

It should be a modified modification. The general code cannot change the content pointing to the pointer; it should be modified with Volatile, you can change it through hardware (assembly language).

2. Usage of Namespace

Namespace recher {

Int model;

Int length;

Int width;

}

Namespace recher1 {

Int Mode

Namespace Recher3

{

Int length;

Int width;

}

}

void main ()

{

Using Namespace Recher1;

Recher :: lonth = 3;

Length = 70;

}

转载请注明原文地址:https://www.9cbs.com/read-27767.html

New Post(0)