字符串的操作

 

memcpy(packetHdr.name,"Mayi",sizeof("Mayi")); 

memcpy(packetHdr.password,"123",sizeof("123"));

 

 

 

判断鼠标是否在一个rect里

POINT   ptCursorPos;   

  GetCursorPos(&ptCursorPos);

 

   rect.left =300;rect.top=20;rect.right =100;rect.bottom =200;

//  if(PtInRect (&rect,ptCursorPos))TextOut(hDC,423,313,(char*)ptCursorPos.x,strlen("123"));

//  ::GetCursorPos(&ptCursorPos);

  if(PtInRect (&rect,ptCursorPos)!=0)

 

 

int gd=800,gm=600,k;

unsigned char chinease[3]="国"

    unsigned char mat[16][2];

    FILE *HZK;

    if((HZK=fopen("hzk16","rb"))==NULL)

        exit(0);

    gd=chinease[0]-0xa0;gm=chinease[1]-0xa0;/*获得区码与位码*/

    fseek(HZK,(94*(gd-1)+(gm-1))*32l,SEEK_SET);

    fread(mat,32,1,HZK);

    for(gm=0;gm<16;gm++)

        for(gd=0;gd<2;gd++)

for(k=0;k<8;k++)

if(mat[gm][gd]&(0x80>>k))/*测试为1的位则显示*/ 

{

::SetPixel (FontDC,gd*8+k,gm,RGB(255,0,0));

 

fclose(HZK);

你可能感兴趣的:(字符串的操作)