cºê¶¨ÒåµÄ¼¼ÇÉ×ܽá
http://blog.csdn.net/eroswang/archive/2009/06/12/4265046.aspx
1,·ÀÖ¹Ò»¸öÍ·Îļþ±»Öظ´°üº¬
#ifndef COMDEF_H
#define COMDEF_H
//Í·ÎļþÄÚÈÝ
#endif
2,ÖØж¨ÒåһЩÀàÐÍ,·ÀÖ¹ÓÉÓÚ¸÷ÖÖƽ̨ºÍ±àÒëÆ÷µÄ²»Í¬,¶ø²úÉúµÄÀàÐÍ×Ö½ÚÊý²îÒì,·½±ãÒÆÖ²¡£
typedef unsigned char boolean; /* Boolean value type. */
typedef unsigned long int uint32; /* Unsigned 32 bit value */
typedef unsigned short uint16; /* Unsigned 16 bit value */
typedef unsigned char uint8; /* Unsigned 8 bit value */
typedef signed long int int32; /* Signed 32 bit value */
typedef signed short int16; /* Signed 16 bit value */
typedef signed char int8; /* Signed 8 bit value */
//ÏÂÃæµÄ²»½¨ÒéʹÓÃ
typedef unsigned char byte; /* Unsigned 8 bit value type. */
typedef unsigned short word; /* Unsinged 16 bit value type. */
typedef unsigned long dword; /* Unsigned 32 bit value type. */
typedef unsigned char uint1; /* Unsigned 8 bit value type. */
typedef unsigned short uint2; /* Unsigned 16 bit value type. */
typedef unsigned long uint4; /* Unsigned 32 bit value type. */
typedef signed char int1; /* Signed 8 bit val
Ïà¹ØÎĵµ£º
×÷Õߣº
Ôøºê°²£¬»ªÇåÔ¶¼ûǶÈëʽѧԺ
¸ß¼¶½²Ê¦¡£
ÔËËã·ûsizeof¿ÉÒÔ¼ÆËã³ö¸ø¶¨ÀàÐ͵ĴóС£¬¶ÔÓÚ32λϵͳÀ´Ëµ£¬sizeof(char) = 1; sizeof(int) = 4¡£»ù±¾Êý¾ÝÀàÐ͵ĴóСºÜºÃ¼ÆË㣬ÎÒÃÇÀ´¿´Ò»ÏÂÈçºÎ¼ÆËã¹¹ÔìÊý¾ÝÀàÐ͵ĴóС¡£
CÓïÑÔÖеĹ¹ÔìÊý¾ÝÀàÐÍÓÐÈýÖÖ£ºÊý×é¡¢½á¹¹ÌåºÍ¹²ÓÃÌå¡£
Êý×éÊÇÏàͬÀàÐ͵ÄÔªËصļ¯ºÏ£¬Ö»Òª»á¼ÆËã ......
1.
¹ØÓÚchar* ºÍconst char*ÒÔ¼°char**ºÍconst char**·Ö±ð×÷Ϊʵ²ÎºÍÐβεÄÎÊÌâ
´«ÖµÊµ¼ÊÉÏÊÇÀàËÆÓÚ¸³ÖµµÄ¡£
Á½¸ö²Ù×÷Êý¶¼ÊÇÖ¸ÏòÏÞ¶¨·û»òÎÞÏÞ¶¨·ûµÄÏàÈÝÀàÐ͵ÄÖ¸Õ룬×ó±ßÖ¸ÕëËùÖ¸ÏòµÄÀàÐͱØÐë¾ßÓÐÓÒ±ßÖ¸ÕëËùÖ¸ÏòÀàÐ͵ÄÈ«²¿ÏÞ¶¨·û¡£ ......
´òÓ¡×Ô¼ºµÄÒ»¶ÎƯÁÁC³ÌÐò
#include <stdio.h>
int main()
{
char *p ="#include <stdio.h>%c int main(){char *p=%c%s%c; printf(p, 10, 34, p, 34);}";
printf(p, 10, 34, p, 34);
} ......
2009-09-13 16:42:43
½ñÌìʵÏÖ¶ÑÕ»½á¹¹²¿·ÖµÄ´úÂ룬²¢ÓÃÒ»¼òµ¥³ÌÐò²âÊԳɹ¦¡£
stack.h:
#ifndef _STACK_H_
#define _STACK_H_
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
#define STACK_INIT_SIZE 5
#define STACKINCREMENT 5
t ......
ÕâһϵÁÐÎÄÕÂÊÇÎÒ¹¹½¨C/C++²å¼þ¿ª·¢¿ò¼Ü¿ª·Å¿ò¼ÜµÄ¹ý³Ì¡£ºóÃæ»áÒ»Ö±¸üУ¬Ö±ÖÁ¹¹½¨Íê³É¡£
¡¶¹¹½¨×Ô¼ºµÄC/C++²å¼þ¿ª·¢¿ò¼Ü£¨Ò»£©——³õ²½ÉèÏë¡·
¡¶¹¹½¨×Ô¼ºµÄC/C++²å¼þ¿ª·¢¿ò¼Ü£¨¶þ£©——×ÜÌ幦ÄÜ¡·
¡¶
¹¹½¨×Ô¼ºµÄC/C++²å¼þ¿ª·¢¿ò¼Ü£¨Èý£©——×ÜÌå½á¹¹
¡·
¡¶¹¹½¨×Ô¼ºµÄC/C++²å¼þ¿ª·¢¿ò¼ ......