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