Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

²âÊÔ¶ÔCµÄÕÆÎճ̶È

 
ÏÂÃæÕâ¸ö³ÌÐòÊä³öʲô£¿
enum {false,true};
int main()
{
int i=1;
do
{
printf("%d\n",i);
i++;
if(i < 15)
continue;
}while(false);
return 0;
}
ÄãÏàÐÅô£¿ÏÂÃæÕâ¸ö³ÌÐòÊä³öµÄÁ½Ðж«Î÷²»Ò»Ñù£¡
#include
#define f(a,b) a##b
#define g(a) #a
#define h(a) g(a)
int main()
{
printf("%s\n",h(f(1,2)));
printf("%s\n",g(f(1,2)));
return 0;
}
ÏÂÃæµÄ³ÌÐò¿´ËÆÍêÈ«ÕýÈ·¡£ÄãÄÜ¿´³öËüΪʲôͨ²»¹ý±àÒëÂð£¿
¿´³öÎÊÌâÇ°²»ÒªÈ¥ÊÔ×űàÒ룬²»È»Äã»áºó»ÚÄãû¿´³öÀ´Õâ¸öµÍ¼¶µÄÓï·¨´íÎó¡£
#include
void OS_Solaris_print()
{
printf("Solaris - Sun Microsystems\n");
}
void OS_Windows_print()
{
printf("Windows - Microsoft\n");
}
void OS_HP-UX_print()
{
printf("HP-UX - Hewlett Packard\n");
}
int main()
{
int num;
printf("Enter the number (1-3):\n");
scanf("%d",&num);
switch(num)
{
case 1:
OS_Solaris_print();
break;
case 2:
OS_Windows_print();
break;
case 3:
OS_HP-UX_print();
break;
default:
printf("Hmm! only 1-3 :-)\n");
break;
}
return 0;
}
ΪʲôÏÂÃæÕâ¸ö³ÌÐòµÄÊä³ö²»ÊÇNONE£¿¿´Äã¶à¾Ã²ÅÄÜ¿´³öÀ´¡£
#include
int main()
{
int a=10;
switch(a)
{
case '1':
printf("ONE\n");
break;
case '2':
printf("TWO\n");
break;
defa1ut:
printf("NONE\n&quo


Ïà¹ØÎĵµ£º

C/C++Èí¼þ¹¤³Ìʦ¾ÍÒµÇóÖ°ÊÖ²á½ÚÑ¡Ò»

 1¡¢ÓзûºÅ±äÁ¿ÓëÎÞ·ûºÅ±äÁ¿ÖµµÄ±ä»»
  ½«ÓзûºÅ±äÁ¿×ª»»ÎªÎÞ·ûºÅ±äÁ¿£¬×¢Ò⸺ÊýµÄת»»¡£
2¡¢ÊýÖµµÄ½»»»
  //ʹÓÃÁÙʱ±äÁ¿
   void Swap1(int &a, int &b)
  {
      int temp = a;
      a = b;
   &nbs ......

¹ØÓÚCµÄÓÐȤÎÊÌâ

//ÒÔϳÌÐòÊÇʵÏÖСдת´óд³ÌÐò
#include<stdio.h>
void to_upper(char *str)
{
    for(;*str !='\0';str++)
    {
        if(unsigned(*str-'a')<='z'-'a')
            *str-='a'-'A';//Ð ......

LinuxÏÂc³ÌÐò¿ª·¢±Ê¼Ç

 µÚÒ»ÕÂ
1.
½âÊÍÐÔÓïÑÔ£ºshell  javascript python  ±à³ÌÈËÔ±²»ÐèÒª¾­¹ý±àÒë Á¬½ÓµÄ¹ý³Ì£¬¿ÉÒÔÔÚÌض¨»·¾³ÏÂÖ±½ÓÖ´ÐеÄÓïÑÔ  ×Ô¶¯±àÒëÁ¬½Ó¡£¿ª·¢Ð§Âʸߣ¬µ«ÔËÐÐЧÂʵ͡£
±àÒëÐÍÓïÑÔ£ºjava c c++£¬ÐèÒª¾­¹ý±à³ÌÈËÔ±¾­¹ý±àÒëºÍÁ¬½Ó²úÉú¿ÉÖ´ÐгÌÐòµÄÓïÑÔ¡£ÔËÐÐЧÂʸߡ£
2.
Êý¾Ý
Êý¾Ý½á¹¹£ºÊý¾ÝÖ®¼äµÄ ......

C/C++ ´ò¿ªPDFÎĵµ

 wchar_t wsWorkingDir[256] = _T("");
 CString strPDF(_T(""));
 ::GetCurrentDirectory(256, wsWorkingDir);
 strPDF.Format(_T("%s"), wsWorkingDir);
 if (strPDF.GetAt(strPDF.GetLength()-1) != '\\')
 {
  strPDF += '\\';
 }
 strPDF += "doc\\my.pdf" ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ