Makeword macro platform: SDK creates a word variable connected by a specified variable. Returns a word variable. (Note: typedef unsigned short word;) Word makeword (byte blow, // specify the low byte order of the new variable; byte bhigh // specify the high byte order of the new variable ;); for example: Word wversionrequested; wversionrequested = makeword (2, 2); # define makeword (A, B) (Word) (byte) (a) | (word) (byte) (B) <8) makeword combines two byte types into one word type, one in high 8-bit (B ), A low 8-bit (a) makelparam, makelong, and makewparam are the same, and the two word types are combined into a DWORD type. A high 16-bit, a low 16-bit such as a = 2; B = 1 2 binary is 00000010 1 binary is 00000001 B represents a high 8-bit, A indicates that the lower 8 bits are merged as 100000010 For example: # include <iostream. h> # include <windows. h> using namespace STD; int main () {word wversionrequested; wversionrequested = makeword (514); cout <wversionrequested <Endl; return 0;} outputs, the preceding two and the following two form a new word. That is, 0000 0010 0000 0010, and the result is: 512 + 2 = 514.
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service