1. Colon (:) usage(1) Represents the definition of a bit field within a mechanism (that is, the variable occupies several bit spaces)typedef struct _xxx{ unsigned char a:4; Char character a accounts for 4 bits unsigned char c;
Transferred from: http://blog.csdn.net/zimingjushi/article/details/65493901. Colon (:) usage(1) Represents the definition of a bit field within a mechanism (that is, the variable occupies several bit spaces)typedef struct _xxx{unsigned char
Note: The following tests are performed under VS2015, and other compilers may be slightly different.
Continue to clean up the rest of the content of the next chapter, the article involved a lot of the content of this article, and then a specific
Note: The following tests are performed under VS2015, and other compilers may be slightly different.
because the content will be more, so split into the top and bottom two pieces to write.
Recently in a base project to do the demand, in the base
1. colon (:) usage
(1) indicates the structure body.Bit domain(That is, the variable occupies several bit spaces)
Typedef struct _ XXX {
Unsigned char A: 4;
Unsigned char C;
} Xxx;
(2) The colon following the constructor acts as a segmentation
1. colon (:) usage
(1) represents the definition of the location domain in the structure (that is, the variable occupies several bit spaces)
Typedef struct _ XXX {
Unsigned char a: 4;
Unsigned char c;
} XXX;
(2) The colon following the constructor
Transfer from http://www.360doc.com/content/13/0605/11/3373961_290615318.shtml1. Colon (:) usage(1) Represents the definition of a bit field within a mechanism (that is, the variable occupies several bit spaces)typedef struct _xxx{unsigned char
(1) denotes the definition of an institution's inner-field (that is, the variable takes up several bit spaces)
Copy Code code as follows:
typedef struct _xxx{
unsigned char a:4;
unsigned char c;
} ; Xxx
(2) The colon at
At first glance, it's easy to allocate memory dynamically in C + +: New is assigned, delete is free, that's simple. However, this article is more complex and takes into account the customization hierarchy. This may not be important for simple
The following is a description of the use of colon and double colon in C + +, the need for friends can come to reference the next
(1) denotes the definition of an institution's inner-field (that is, the variable takes up several bit spaces)
Copy
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.