C/C++ÓïÑÔÖи÷ÖÖÊý¾ÝÀàÐͳ¤¶ÈµÄ×ܽá
ÏÂÃæÊÇÎÒ¹ØÓÚCÓïÑÔÖи÷ÖÖÊý¾ÝÀàÐͳ¤¶ÈµÄ×ܽ᣺(²Î¿¼The C Programming Language)
1. cÓïÑÔÖеÄÕûÊýÀàÐÍÓÐchar, short, int, longµÈ¼¸ÖÖ, ÏÂÃæÊÇCÓïÑÔ¶ÔÿÖÖÊý¾ÝÀàÐͳ¤¶ÈµÄ¹æ¶¨:
(a). shortºÍlongÀàÐ͵ij¤¶È²»Ïàͬ
(b). intÀàÐÍͨ³£Í¬¾ßÌå»úÆ÷µÄÎïÀí×Ö³¤Ïàͬ
(c). shortͨ³£ÊÇ16bits, intͨ³£ÊÇ16bits or 32bitsÿÖÖ±àÒëÆ÷¿ÉÒÔ¸ù¾ÝÓ²¼þµÄ²»Í¬×ÔÓÉÈ·¶¨, µ«ÊÇshortºÍint±ØÐë×îÉÙÊÇ16bits, ¶ølongÀàÐͱØÐë×îÉÙÊÇ32bits, ²¢ÇÒshort±ØÐë±ÈintºÍlongÀàÐÍÒª¶Ì¡£
2. sizeof() ÔËËã·û·µ»ØµÄÊÇÒ»ÖÖÊý¾ÝÀàÐÍÖÐËù°üº¬µÄ×Ö½ÚÊý(bytes), AnsiC¹æ¶¨sizeof(char)±ØÐë·µ»Ø1£¬µ±sizeof×÷ÓÃÓÚÊý×éʱ, ·µ»ØµÄÊÇÊý×éÖÐËùÓгÉÔ±ËùÕ¼µÄ×Ö½ÚÊý(×¢Òâ²¢²»ÊÇÊý×éÖгÉÔ±µÄ¸öÊý), µ±sizeof()×÷ÓÃÓڽṹÌåºÍ¹«ÓÃÌåʱ,·µ»ØµÄ²»½ö½öÊÇÊý¾Ý³ÉÔ±×ܵÄ×Ö½ÚÊý, »¹°üÀ¨±àÒëÆ÷ΪÁËʵÏÖ×Ö½Ú¶ÔÆä¶øÌî³äµÄÄÇЩ×Ö½Ú¡£
ÒÔǰд³ÌÐòÒ²ÒþÒþÔ¼Ô¼µÄ¶®µÃÕâЩ¹æÔò£¬µ«ÊÇÒ»Ö±ÒÔΪcharÀàÐͱØÐëÊÇ8bitsµÄ£¬µ«ÊÇ×î½ü×öÁËÒ»¸öǶÈëʽDSPÏîÄ¿£¬±àÒëÆ÷ÊÖ²áÉÏÃ÷Ã÷д×ÅcharÀàÐ;ÍÊÇ16bitsµÄ£¬ÎÞÄη³ö"The C Programming Language"Ò»²é²Å·¢ÏÖANSI C¶ÔÓÚcharÀàÐ͵ij¤¶È²¢Ã»ÓÐ×÷Ó²ÐԹ涨¡£ÒÔǰд³ÌÐò²»Ì«×¢ÒâÊý¾ÝÀàÐ͵ĿÉÒÆÖ²ÐÔ, Õâ´ÎÏîÄ¿ÖÐÓõ½µÄÒÔÇ°µÄ´úÂ붼ҪÖØмì²éÊý¾ÝÀàÐͳ¤¶ÈµÄÎÊÌâ¡£
C++Êý¾ÝÀàÐͳ¤¶ÈÎÊÌâ:
Ò»¡¢×Ö½ÚºÍ×Ö³¤
×Ö½Ú£¬°Ëλ¾ÍÊÇÒ»¸ö×Ö½Ú£¬Êǹ̶¨¸ÅÄî¡£×Ö³¤ÊÇÖ¸¼ÆËã»úÒ»´ÎÄÜ´¦ÀíµÄ¶þ½øÖÆÊý¾ÝµÄ³¤¶È£¬ÊÇÒ»¸ö·Ç¹Ì¶¨µÄ¸ÅÄî¡£ÀýÈ磬8λ¼ÆËã»úµÄ×Ö³¤Îª8£¬¼´Ò»¸ö×Ö½Ú£¬ 32λ¼ÆËã»úµÄ×Ö³¤Î»32£¬¼´4¸ö×Ö½Ú£¬Í¬Àí£¬64λ¼ÆËã»úµÄ×Ö³¤Îª64£¬¼´8×Ö½Ú¡£
¶þ¡¢C++ÖеÄÊý¾ÝÀàÐÍ
1¡¢×Ö·ûÐÍÊý¾Ýchar£¬¸ÃÀàÐÍʼÖÕÊÇÒ»¸ö×Ö½Ú³¤£¬¼´8λ¡£
2¡¢ÕûÐÎint¡¢¶ÌÕûÐÍshortºÍ³¤ÕûÐÎlong¡£Í¨³£intΪһ¸ö×Ö³¤£¬shortΪ°ë¸ö×Ö³¤£¬longΪһ¸ö»ò2¸ö×Ö³¤£¨ÔÚ32λ»úÆ÷ÖÐΪһ¸ö×Ö³¤£©¡£
3¡¢¸¡µãÐÍfloat¡¢Ë«¾«¶Èdouble¡¢ºÍ³¤Ë«¾«¶Èlong double£¬·Ö±ð±íʾµ¥¾«¶È¸¡µãÊý Ë«¾«¶È¸¡µãÊýºÍÀ©Õ¹¾«¶ÈµÄ¸¡µãÊýÖµ¡£µäÐÍÇé¿öÏ£¬float Ϊһ¸ö×Ö£¬doubleÊÇÁ½¸ö×Ö£¬long doubleΪÈý¸ö»òËĸö×Ö¡£
Ïà¹ØÎĵµ£º
ÍøÉÏÒ»µÀ½ðɽµÄÃæÊÔÌ⣺
http://topic.csdn.net/u/20100524/14/0eff992a-2849-4db6-bdaa-d4a200e79b7c.html
Çë·Ö±ðÓÃC++µÄÃæÏò¶ÔÏóºÍ·ºÐÍ»úÖÆ£¬±àдʵÏÖTemplate MethodģʽµÄʾÀý´úÂ룬²¢±È½ÏÁ½ÖÖ·½Ê½¸÷×ÔµÄÓÅȱµã¡£
ÓÃÐ麯ÊýʵÏÖTemplate MethodµÄ·½Ê½¾Í²»¶à˵ÁË¡£Ó÷ºÐ͵ķ½Ê½ÊµÏÖ¶à̬ÔÚATLÀïÃæÓдóÁ¿µÄÓõ½£¡
·ºÐ͵ ......
ÔÚPOSIXÖУ¬±ãÓÐ×ÅÖ§³ÖÕýÔò±í´ïʽµÄϵͳº¯Êý¡£GNU/LinuxÓÐÁ½Ì׿â¿ÉÓÃÓÚÕýÔò±í´ïʽ±à³Ì£ºPOSIX¿âºÍPCRE¿â¡£Ç°Õß²»ÐèÒªµ¥¶À°²×°£¬Ò»°ãÐèÇó»¹ÊÇÄÜÂú×ãµÄ£¬ËÙ¶ÈÉÔÂýЩ¡£ºóÕßÊǾøºÊ¢ÃûµÄPerlÕýÔò±í´ïʽ¿â£¬¹¦ÄÜÇ¿´ó£¬Æ¥ÅäËٶȿ죬²»¹ý¿ÉÄÜÐèÒªµ¥¶À°²×°¡£
int regcomp (regex_t *compiled, const char *pattern, int cflags)
& ......
Linux/UNIX C++¸ß¼¶Åàѵ---Ô¶³Ì°à
http://www.xuanyuan-soft.cn/index.php?option=com_content&view=article&id=84&Itemid=85
¿Î³Ì¸ÅÒª
ÅàÑøÄ¿±ê
£ºLinux/UNIX C++Èí¼þ¹¤³Ìʦ
רעLinux/UNIX·þÎñÆ÷¶ËµÄÈí¼þ¿ª·¢£¨ºǫ́¿ª·¢£©£¬ÅàÑøÆóÒµËùÐèµÄרҵLinux/UNIX C ......
°ÑÊäÈëµÄÒ»´®×Ö·ûת³ÉÊý×飬ת³ÉÁ´±í£¬È»ºóɾȥÆäÖÐÖ¸¶¨µÄ×Ö·û£¬ÔÚβ²¿Ìí¼ÓÒ»¸ö×Ö·û¡£
£¨³ÌÐò»¹²»ÍêÉÆ£¬Ã»ÓжÔÊä´íµÄÇé¿ö½øÐд¦Àí£¬£¬ÔÝʱÏÈÕâÑù°É¡£¡£= =¡££©
#include<stdio.h>
#include<malloc.h>
#define LEN sizeof(struct link)
struct link
{
char ch;
struct link *next;
}*string;
char a ......