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

C/C++ Ö®ÂÃ

ûÏëµ½ ûÏëµ½ ÍòÍòûÏëµ½
¶ÔC++°ËÇÏֻͨÁË7ÇϵÄÎÒ£¬¾¹È»Òª¿ªÊ¼¸ãc++Á˵Ä˵£¬ÕæÊǺò»´Ì¼¤¡£
²»¸ÒÏàÐÅ£¬²»¸ÒÏàÐÅ¡£
ÀàÐÍÊÇÊ²Ã´ÍæÒ⣿ÀàÔõôд£¿×Ö·û´®Ôõô´¦Àí£¿ÔõôÊÍ·ÅÄڴ棿
ż²»Öª£¬²»Öª£¬ÕæµÄ²»Öª¡£¡£¡£¡£
°¥       Íê¶¼ÍêÁË¡£
°¦ ²»¹ÜÔõô˵¶¼ÒªÈ¥Ñ§µÄ¡£¡£¡£Ò»µãÕÞ¶¼Ã»ÓÐ
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
namespace Algorythms
{

int insert_sort(int Array[],int Length)
{
for( int i = 0 ; i < Length ; i ++ )
{
int p = i;
for( int j = i ; j < Length ; j ++ )
{
if(Array[j] < Array[p])
{
p = j;
}
}
if(p != i) //Swap
{
int tmp = Array[p];
Array[p] = Array[i];
Array[i] = tmp;
}
}
return 0;
}

int Merge(int Array[],int p,int q,int r)
{
int a = q - p + 1;
int b = r - q;
int *L = new int[a + 1];
int *R = new int[b + 1];
int i = 0;
int j = 0;
for(i = 0; i < a; i ++)
{
L[i] = Array[p+i];
}
for(i = 0; i < b; i ++)
{
R[i] = Array[q+i+1];
}
L[a] = 0x7FFFFFF;
R[b] = 0x7FFFFFF;
i = 0;
j = 0;
for(int k = p; k <= r ; k ++)
{
if(L[i] <= R[j])
{
Array[k] = L[i];
i ++;
}
else
{
Array[k] = R[j];
j ++;
}
}
return 0;
}
int Merge_Sort(int Array[],int p,int r)
{
if(p < r)
{
int q = (p + r) / 2;
Merge_Sort(Array,p,q);
Merge_Sort(Array,q+1,r);
Merge(Array,p,q,r);
}
return 0;
}
int Reserver(int Array[],int Length)
{
int * e = Array + Length -1;
int * f = Array;
while(f < e)
{
int tmp = *f;
*f = *e;
*e = tmp;
f ++;
e --;
}
return 0;
}
int Exchange(int *a,int *b)
{
int tmp = *a;
*a = *b;
*b = tmp;
return 0;
}
int Bubble_Sort(int Array[],int Length)
{
for(int i = 0; i < Length - 1; i ++)
{
for(int j = Length - 1; j >= i + 1; j --)
{
if(Array[j] < Array[j - 1])
{
Ex


Ïà¹ØÎĵµ£º

C/C++ÃæÊÔÌâÁù£¨¾­µä) ¡¾×ª¡¿

1.ÇóÏÂÃæº¯ÊýµÄ·µ»ØÖµ£¨Î¢Èí£©
int func(x)
{
    int countx = 0;
    while(x)
    {
          countx ++;
          x = x&(x-1);
     } ......

linux±àдc³ÌÐò·¢ÏÖ

Õ⼸ÌìÎÒ°²×°ÁËÒ»¸öLinuxϵͳ£¬ÏëÔÚÀïÃæÑ§Ò»ÏÂCÓïÑԵıàд£¬·¢ÏÖÔÚÀïÃæÔËÐÐÓÐÒ»¸öºÃÆæ¹ÖµÄÏÖÏó£ºÈçÏÂÃæ
#include<stdio.h>
void mian(){
printf("hello world!");
}
Êä³öûÓнá¹û£¡¸ãµÄÎÒ¿´Á˰ëÌ죬³ÌÐòûÓдíÎó°¡£¡ÔõôÕâÑù£¡ºóÀ´ÎҰѳÌÐò¸ÄΪ
#include<stdio.h>
void mian(){
printf("hello ......

Turbo C 2.0 º¯ÊýÖÐÎÄ˵Ã÷´óÈ«

Turbo C 2.0 º¯ÊýÖÐÎÄ˵Ã÷´óÈ«
·ÖÀຯÊý,ËùÔÚº¯Êý¿âΪctype.h
int isalpha(int ch) ÈôchÊÇ×Öĸ('A'-'Z','a'-'z')·µ»Ø·Ç0Öµ,·ñÔò·µ»Ø0
int isalnum(int ch) ÈôchÊÇ×Öĸ('A'-'Z','a'-'z')»òÊý×Ö('0'-'9'),·µ»Ø·Ç0Öµ,·ñÔò·µ»Ø0
int isascii(int ch) ÈôchÊÇ×Ö·û(ASCIIÂëÖеÄ0-127)·µ»Ø·Ç0Öµ,·ñÔò·µ»Ø0
int iscntrl(int ......

memcached Óëc/c++ÔËÓÃ

ÐÞ¸Ämakefile£¬ÔÚLIBSÀïÃæ¼ÓÉÏ-lmemcached£¬±ÈÈçÔ­À´ gcc test.c£¬ÏÖÔÚ gcc test.c -lmemcached¡£Õâ¸ö¿â¾ÍÊÇlibmemcachedÌṩµÄ¡£
È»ºóÌí¼Ó#include<libmemcached/memcached.h>£¬Õâ¸öÎļþÒ²ÊÇlibmemcachedÌṩµÄ¡£
Ö÷º¯ÊýÀïÃæÐèÒªÌí¼Ó£º
    memcached_st *memc;
    uint32_t&nbs ......

c ÓïÑÔÖдøconst µÄÖ¸ÕëС¼Ç

Ò»¡¢ÓÐÈçÏ´úÂ룺
int age = 25;
const int *pAge = &age;

ÉÏÃæµÄ´úÂë±íʾ£º
1¡¢Ö¸Õë±äÁ¿pAge´æ·Å±äÁ¿ageµÄµØÖ·£¬ÇÒ²»ÄÜͨ¹ý *pAge = 30£¬À´¸Ä±äÖ¸Õë±äÁ¿pAgeËùÖ¸ÏòµÄ´æ´¢¿Õ¼äµÄÖµ£¬µ«ÊÇ ¶ÔÓÚ age = 30£¬ÔòÊÇûÓÐÎÊÌâµÄ¡£
2¡¢pAge ±¾Éí¿ÉÒÔÔÙ´æ·ÅÆäËü±äÁ¿µÄµØÖ·£¬Ò²¿ÉÒÔÖ¸ÏòNULL£¬Èç pAge = NULL;ÊÇÕýÈ·µÄ¡£
¶ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ