cÅжϺº×Ö
#include <windows.h>
int IsGB(PTSTR pText);
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
static TCHAR szText[] = {TEXT ("i·þ,ÁË¡£u£ù")} ;
PTSTR pText;
int i;
unsigned char sqChar[20];
pText=szText;
while (*pText != '\0')
{
i=IsGB(pText);
switch(i)
{
case 0:
pText++;
MessageBox (NULL, TEXT ("·¢ÏÖÊý×Ö¡¢Ó¢ÎÄ×Ö·û»òÓ¢Îıêµã"), TEXT ("Hello"), 0);
break;
case 1:
pText++;
pText++;
MessageBox (NULL, TEXT ("·¢ÏÖÈ«½Ç×Ö·û"), TEXT ("Hello"), 0);
break;
case 2:
pText++;
pText++;
MessageBox (NULL, TEXT ("·¢ÏÖºº×Ö"), TEXT ("Hello"), 0);
break;
}
}
return 0 ;
}
int IsGB(PTSTR pText)
{
unsigned char sqChar[20];
sqChar[0]=*pText;
if (sqChar[0]>=0xa1)
if (sqChar[0]==0xa3)
return 1; //È«½Ç×Ö·û
else
return 2; //ºº×Ö
else
return 0; //Ó¢ÎÄ¡¢Êý×Ö¡¢Ó¢Îıêµã
}
Ïà¹ØÎĵµ£º
//#include "stdafx.h"
/*
ÃèÊö:´¿cÄ£ÄâÀà,´¿c±àдc++Àà,´¿cʵÏÖc++ÀàµÄ¼òµ¥·¶Àý,½á¹¹Ä£ÄâÀà,struct ±àдclass.
c±àдÀàÊÇʵÏÖ´¿c±àдcom×é¼þµÄ»ù´¡¡£
*/
#include <stdio.h>
typedef struct _Vtbl
{
void (*AddRef)(struct CObject* obj,int);//ËùÓеĺ¯ÊýµÄµÚÒ»¸ö²ÎÊýÀàËÆclassµÄÒþÄäµÄ ......
http://www.ddj.com/cpp/221600722
Q: HOW DO I... put timers with default actions in my C code?
A: Many times, we need to write programs that will only wait a certain specified amount of time for a user to do something. After that time, we need to assume that the user isn't going to do anything and ......
¿´Êý¾Ý½á¹¹ñÍÕ»µÄʱºòдÁËÕâôһ¶Î´úÂë
#include<stdio.h>
#include<stdlib.h>
struct linkstack
{
int data;
struct linkstack *next;
};
int initstack(linkstack * S)
{
S = (linkstack *)malloc(sizeof(linkstack));
if(S == NULL) return 0;
S->next = NULL;
return 1;
}
int main(int ......
c º¯ÊýÖ¸Õë
º¯ÊýÖ¸ÕëÊÇʲô£¿
Ò»¸öº¯ÊýÕ¼ÓÃÒ»¶ÎÁ¬ÐøÄÚ´æ¡£µ±µ÷ÓÃÒ»¸öº¯Êýʱ£¬Êµ¼ÊÉÏÊÇÌø×ªµ½º¯ÊýÈë¿ÚµØÖ·£¬Ö´Ðк¯ÊýÌåµÄ´úÂ룬Íê³Éºó·µ»Ø¡£
ÈçºÎÕÒµ½¶ÔÓ¦µÄÈë¿ÚµØÖ·£¿
ÕâÊÇÓɺ¯ÊýÃûÀ´±ê¼ÇµÄ£¬Êµ¼ÊÉÏ£¬º¯ÊýÃû¾ÍÊǺ¯ÊýµÄÈë¿ÚµØÖ·¡£ º¯ÊýÖ¸ÕëÊÇÒ»ÖÖÌØÊâÀàÐ͵ÄÖ¸Õë£¬Ë ......
C/C++ÖÐnearºÍfarµÄÇø±ð
¹Ø¼ü×ÖnearºÍfarÊÜÄ¿±ê¼ÆËã»úÌåϵ½á¹¹µÄÓ°Ï졣Ŀǰ±à³ÌÖÐʹÓò»¶à¡£
near¹Ø¼ü×Ö´´½¨Ò»¸öÖ¸Ïò¿ÉѰַÄÚ´æµÍ¶Ë²¿·ÖµÄÄ¿±êÖ¸Õë¡£ÕâЩָÕëÕ¼ÓÃÄÚ´æµÄµ¥Ò»×Ö½Ú£¬²¢ÇÒËûÃÇÄܹ»Ö¸ÏòµÄÄÚ´æµ¥Ôª±»ÏÞÖÆµ½256¸öλÖã¬Í¨³£ÊÇÔÚ0x0000~0x00ff·¶Î ......