C±ê×¼¿âÍ·Îļþ assert.h
C±ê×¼¿âÍ·Îļþ assert.h
@º¯ÊýÃû³Æ: assert
º¯ÊýÔÐÍ: void assert(int exp)
º¯Êý¹¦ÄÜ: Õï¶ÏÀࣺ±í´ïʽ½á¹ûÕýÈ·ÐÔ²âÊÔ²¢¿Éʹ³ÌÐòÖÐÖ¹
º¯Êý·µ»Ø:
²ÎÊý˵Ã÷: ½«´íÎóÐÅÏ¢Êä³öµ½Á÷stderrÖУ¬Èç¹ûexpΪ0£¬ÔòÖÐÖ¹³ÌÐòÖ´ÐÐ.exp-±í´ïʽ
ËùÊôÎļþ: <assert.h>
#include <stdio.h>
#include <assert.h>
void process_string(char *string)
{
/* use assert to check argument */
assert(string!=NULL);
assert(*string!='\0');
/* rest of code follows here */
}
int main()
{
process_string("hello");
process_string("");
return 0;
}
±¾ÎÄÀ´×ÔCSDN²©¿Í£¬×ªÔØÇë±êÃ÷³ö´¦£ºhttp://blog.csdn.net/lixinlu2000/archive/2006/11/18/1394975.aspx
Ïà¹ØÎĵµ£º
ÕâÁ½Ìì¿´µ½ÓÐÈËÌÖÂ۵绰¼üÅÌÉϵÄ×Öĸ¡¢ºÅÂëºÍ×ÖĸµÄת»»£¬ÎÒÒ²Ëæ±ãдÁËÒ»¶Î
#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", ......
Ò»Ö±¶¼¸Ðµ½ºÜÃÔ㣬¶ÔÓÚÓïÑÔµÄÑ¡Ôñ£¬ÒòΪ»¹ÊDzËÄñµÄÔÒò£¬ÎÞ·¨¿´Í¸ÀïÃæµÄÖÖÖÖ¹ØÏµ£¬Ò»Ö±ÔÚ¾À½áÆäÖС£Æäʵ×Ô¼ºÒ²Ã÷°×“´óµÀÖÁ¼ò”£¬µ«»¹Êǰ´ÄͲ»×¡¿ñÏëµÄ˼Ð÷£¬ÌرðÊǵ±´Ó¹«Ë¾³ö²î»ØÀ´Ö®ºó£¬¼¸Ì춼ûÓÐ×öʲôÊÂÇé¡£
¶ÔCÓÐÒ»ÖÖÆ«ºÃ£¬ËùÒÔÒ»Ö±ÔÚÐÄÀï¾ÍÓеãÅųâjava¡£ËäÈ»javaÖÐÒ²ÓкܶණÎ÷Ҫѧ£¬µ«ÊÇDZÒâʶÀïÃæ¶ÔÕ ......
#include <stdio.h>
int main()
{
int a[5]={1,2,3,4,5};
int *ptr1=(int*)(&a+1);
int *ptr2=(int*)((int)a+1);
printf("%p,%x,%p\n",(int)a,*(ptr2+1),ptr1);//(int*)(&a));
printf("%d\n",(int*)(&a-16));
printf("%d,%x\n",ptr1[-1] ......
¼ì²é¿Õ¸ñ×Ö·û
#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 ......
ÒýÑÔ
¡¡¡¡Ö¸ÕëÊÇC/C++ÓïÑÔµÄÌØÉ«£¬¶øÊý×éÃûÓëÖ¸ÕëÓÐÌ«¶àµÄÏàËÆ£¬ÉõÖÁºÜ¶àʱºò£¬Êý×éÃû¿ÉÒÔ×÷ΪָÕëʹÓá£ÓÚÊǺõ£¬ºÜ¶à³ÌÐòÉè¼ÆÕ߾ͱ»¸ãºýÍ¿ÁË¡£¶øÐí¶àµÄ´óѧÀÏʦ£¬ËûÃÇÔÚCÓïÑԵĽÌѧ¹ý³ÌÖÐÒ²´íÎóµÃ¸øÑ§Éú½²½â£º"Êý×éÃû¾ÍÊÇÖ¸Õë"¡£ºÜÐÒÔË£¬ÎҵĴóѧÀÏʦ¾ÍÊÇÆäÖÐÖ®Ò»¡£Ê±ÖÁ½ñÈÕ£¬ÎÒÈÕ¸´Ò»ÈյؽøÐÐ×ÅC/C++Ï ......