C + + knowledge points

Source: Internet
Author: User

typedef

typedefstruct_comstat {DWORD fctshold:1;//the definition of the internal bit field of the mechanism is variable Fctshold occupies 1 bit spaceDWORD Fdsrhold:1; DWORD Frlsdhold:1; DWORD Fxoffhold:1; DWORD fxoffsent:1; DWORD fEof:1; DWORD Ftxim:1; DWORD freserved: -;    DWORD Cbinque; DWORD Cboutque;} Comstat,*Lpcomstat;//typedef//1: Define a type of aliastypedefChar* PCHAR;//General CapitalizationPCHAR PA, PB;//It is possible to declare two pointers to a character variable//Note the followingChar* PA, PB;//it only declares a pointer to a character variable and a character variable//2. Define the alias of the struct type and declare it directly: the name of the struct-name object//3. Use typedef to define platform-independent types for easy change of code on platform//4. Define a new simple alias for complex declarationstypedefvoid(*lpdataarriveproc) (Char*data,intLength,dword UserData); //defines lpdataarriveproc as a pointer to a function that points to a return value of void, which is a variable (char *data,int length,dword userdata)

Char and CString cross-turn

//CString Turn Char///////////////////////////////////////CString thestring =_t ("Char"); LPTSTR lpsz=NewTchar[thestring.getlength () +1];_tcscpy (lpsz, thestring);//Char turn CString///////////////////////////////////////CharCharray[] ="Char"; CString Strx=cstring (Charray). Left (sizeof(Charray)); Setdlgitemtext (IDC_EDIT_SCANCODE,STRX);

C + + knowledge points

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.