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

C³£Óú¯Êý

¼ì²é¿Õ¸ñ×Ö·û
#include <ctype.h>
int isspace ( int c );
http://www.cplusplus.com/reference/clibrary/cctype/isspace/
Checks if parameter c is a white-space character.For the purpose of this function, standard white-space characters are:
' '
(0x20)
space (SPC)
'\t'
(0x09)
horizontal tab (TAB)
'\n'
(0x0a)
newline (LF)
'\v'
(0x0b)
vertical tab (VT)
'\f'
(0x0c)
feed (FF)
'\r'
(0x0d)
carriage return (CR)
 /* isspace example */
#include <stdio.h>
#include <ctype.h>
int main ()
{
int c;
int i=0;
char str[]="Example sentence to test isspace\n";
while (str[i])
{
c=str[i];
if (isspace(c)) c='\n';
putchar (c);
i++;
}
return 0;
}

/*
This code prints out the C string character by character, replacing any white-space character by a newline character. Output:

Example
sentence
to
test
isspace
*/


memcpyʵÏÖ£º
char *strcpy(char *strDest, const char *strSrc){
assert((strDest!=NULL) && (strSrc !=NULL)); // 2·Ö
char *address = strDest; // 2·Ö
while( (*strDest++ = * strSrc++) != '\0' ) // 2·Ö
NULL ;
return address ; // 2·Ö
}


Ïà¹ØÎĵµ£º

LinuxÏ c ÅжÏÒ»¸öÎļþÊÇ·ñ´æÔÚ

#include <stdio.h>
#include <unistd.h>
#define FOO "foo"
int main(void)
{
if(!access(FOO, F_OK))
{
if(!unlink(FOO))
{

}
else
{
printf("remove %s failed\n", FOO);
}
}
else
{
printf("%s not existed\ ......

C/C++±ÊÊÔÌâÄ¿´óÈ«

 1.ÇóÏÂÃæº¯ÊýµÄ·µ»ØÖµ£¨Î¢Èí£©
¡¡¡¡int func(x)
¡¡¡¡{
¡¡¡¡int countx = 0;
¡¡¡¡while(x)
¡¡¡¡{
¡¡¡¡countx ++;
¡¡¡¡x = x&(x-1);
¡¡¡¡}
¡¡¡¡return countx;
¡¡¡¡}
¡¡¡¡¼Ù¶¨x = 9999¡£ ´ð°¸£º8
¡¡¡¡Ë¼Â·£º½«xת»¯Îª2½øÖÆ£¬¿´º¬ÓеÄ1µÄ¸öÊý¡£
¡¡¡¡2. ʲôÊÇ“ÒýÓÔ£¿ÉêÃ÷ºÍʹÓÓÒýÓ ......

c´úÂ룺µç»°ºÅÂëºÍ×Öĸת»»

ÕâÁ½Ìì¿´µ½ÓÐÈËÌÖÂ۵绰¼üÅÌÉϵÄ×Öĸ¡¢ºÅÂëºÍ×ÖĸµÄת»»£¬ÎÒÒ²Ëæ±ãдÁËÒ»¶Î
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#define MAX_LEN 15
char *tbl_itoa[] =
{
"0", // 0
"1", // 1
"ABC", // 2
"DEF", // 3
"GHI", // 4
"JKL", // 5
"MNO", ......

C#£¨C sharp£©×Ö·û´®ºÍʱ¼äµÄÏ໥ת»»

C#£¨C sharp£©×Ö·û´®ºÍʱ¼äµÄÏ໥ת»»¡£
 
Ò»¡¢DateTime –> string
ʱ¼äÀàÐÍת»¯³É×Ö·û´®ÀàÐÍ£¬ÄÇÊÇÏ൱µÄ¼òµ¥£¬Ö±½Óµ÷ÓÃToString()·½·¨¼´¿É¡£È磺
DateTime dt = DateTime.Now;
string dtStr = dt.ToString();
 
Èç¹ûÏë¶ÔÊä³ö¸ñʽ»¯£¬¿ÉÒÔÕâôд£º
dt.ToString("yyyyÄêMMÔÂddÈÕ");   ......

C±àÒëµÄαָÁî

Ò»°ã±äÁ¿¶¨ÒåÔÚ*.cÎļþÖÐ,¶ø*.hÎļþÖÐÉùÃ÷±äÁ¿»òº¯ÊýÃûºÍ·ûºÅÃû.
±ÜÃæÖØ¸´±àÒëµÄ½â¾ö·½·¨:
    ±ÈÈçÄãÓÐÁ½¸öCÎļþ£¬ÕâÁ½¸öCÎļþ¶¼includeÁËͬһ¸öÍ·Îļþ¡£¶ø±àÒëʱ£¬ÕâÁ½¸öCÎļþ¶¼Òªµ÷ÓÃͬһ¸öÍ·ÎļþÈ¥±àÒë£¬ÖØ¸´±àÒë»á²úÉú´óÁ¿µÄÉùÃ÷³åÍ»¡£½â¾öÕâ¸öÎÊÌâµÄ·½·¨Ê¹ÓÃ#ifndef, #endif, #endif¡£
 &nbs ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ