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

c ÓïÑÔÏÝÚå

Ô­Öø£ºAndrew Koenig - AT&T Bell Laboratories Murray Hill, New Jersey 07094
·­Ò룺lover_P
0 ¼ò½é
    CÓïÑÔ¼°ÆäµäÐÍʵÏÖ±»Éè¼ÆΪÄܱ»×¨¼ÒÃÇÈÝÒ×µØʹÓá£ÕâÃÅÓïÑÔ¼ò½à²¢¸½Óбí´ïÁ¦¡£µ«ÓÐһЩÏÞÖÆ¿ÉÒÔ±£»¤ÄÇЩ¸¡ÔêµÄÈË¡£Ò»¸ö¸¡ÔêµÄÈË¿ÉÒÔ´ÓÕâЩÌõ¿îÖлñµÃһЩ°ïÖú¡£
    ÔÚ±¾ÎÄÖУ¬ÎÒÃǽ«»á¿´Ò»¿´ÕâЩδ¿ÉÖªµÄÒæ´¦¡£ÕâÊÇÓÉÓÚËüµÄδ¿ÉÖª£¬ÎÒÃÇÎÞ·¨ÎªÆä½øÐÐÍêÈ«µÄ·ÖÀà¡£²»¹ý£¬ÎÒÃÇÈÔȻͨ¹ýÑо¿ÎªÁËÒ»¸öC³ÌÐòµÄÔËÐÐËùÐèÒª×öµÄÊÂÀ´×öµ½ÕâЩ¡£ÎÒÃǼÙÉè¶ÁÕ߶ÔCÓïÑÔÖÁÉÙÓиö´ÖdzµÄÁ˽⡣
    µÚÒ»²¿·ÖÑо¿Á˵±³ÌÐò±»»®·ÖΪ¼ÇºÅʱ»á·¢ÉúµÄÎÊÌâ¡£µÚ¶þ²¿·Ö¼ÌÐøÑо¿Á˵±³ÌÐòµÄ¼ÇºÅ±»±àÒëÆ÷×éºÏΪÉùÃ÷¡¢±í´ïʽºÍÓï¾äʱ»á³öÏÖµÄÎÊÌâ¡£µÚÈý²¿·ÖÑо¿ÁËÓɶà¸ö²¿·Ö×é³É¡¢·Ö±ð±àÒë²¢°ó¶¨µ½Ò»ÆðµÄC³ÌÐò¡£µÚËIJ¿·Ö´¦ÀíÁ˸ÅÄîÉϵÄÎó½â£ºµ±Ò»¸ö³ÌÐò¾ßÌåÖ´ÐÐʱ»á·¢ÉúµÄÊÂÇé¡£µÚÎ岿·ÖÑо¿ÁËÎÒÃǵijÌÐòºÍËüÃÇËùʹÓõij£ÓÿâÖ®¼äµÄ¹Øϵ¡£ÔÚµÚÁù²¿·ÖÖУ¬ÎÒÃÇ×¢Òâµ½ÁËÎÒÃÇËùдµÄ³ÌÐòÒ²²»²¢²»ÊÇÎÒÃÇËùÔËÐеijÌÐò£»Ô¤´¦ÀíÆ÷½«Ê×ÏÈÔËÐС£×îºó£¬µÚÆß²¿·ÖÌÖÂÛÁË¿ÉÒÆÖ²ÐÔÎÊÌ⣺һ¸öÄÜÔÚÒ»¸öʵÏÖÖÐÔËÐеijÌÐòÎÞ·¨ÔÚÁíÒ»¸öʵÏÖÖÐÔËÐеÄÔ­Òò¡£
1 ´Ê·¨È±ÏÝ
    ±àÒëÆ÷µÄµÚÒ»¸ö²¿·Ö³£±»³ÆΪ´Ê·¨·ÖÎöÆ÷£¨lexical analyzer£©¡£´Ê·¨·ÖÎöÆ÷¼ì²é×é³É³ÌÐòµÄ×Ö·ûÐòÁУ¬²¢½«ËüÃÇ»®·ÖΪ¼ÇºÅ£¨token£©Ò»¸ö¼ÇºÅÊÇÒ»¸öÓÐÒ»¸ö»ò¶à¸ö×Ö·ûµÄÐòÁУ¬ËüÔÚÓïÑÔ±»±àÒëʱ¾ßÓÐÒ»¸ö£¨Ïà¹ØµØ£©Í³Ò»µÄÒâÒå¡£ÔÚCÖУ¬ ÀýÈ磬¼ÇºÅ->µÄÒâÒåºÍ×é³ÉËüµÄÿ¸ö¶ÀÁ¢µÄ×Ö·û¾ßÓÐÃ÷ÏÔµÄÇø±ð£¬¶øÇÒÆäÒâÒå¶ÀÁ¢ÓÚ->³öÏÖµÄÉÏÏÂÎÄ»·¾³¡£
    ÁíÍâÒ»¸öÀý×Ó£¬¿¼ÂÇÏÂÃæµÄÓï¾ä£º
if(x > big) big = x;
¸ÃÓï¾äÖеÄÿһ¸ö·ÖÀëµÄ×Ö·û¶¼±»»®·ÖΪһ¸ö¼ÇºÅ£¬³ýÁ˹ؼü×ÖifºÍ±êʶ·ûbigµÄÁ½¸öʵÀý¡£
    ÊÂʵÉÏ£¬C³ÌÐò±»Á½´Î»®·ÖΪ¼ÇºÅ¡£Ê×ÏÈÊÇÔ¤´¦ÀíÆ÷¶ÁÈ¡³ÌÐò¡£Ëü±ØÐë¶Ô³ÌÐò½øÐмǺŻ®·ÖÒÔ·¢ÏÖ±êʶºêµÄ±êʶ·û¡£Ëü±ØÐëͨ¹ý¶Ôÿ¸öºê½øÐÐÇóÖµÀ´Ìæ»»ºêµ÷Óá£×îºó£¬¾­¹ýºêÌæ»»µÄ³ÌÐòÓÖ±»»ã¼¯³É×Ö·ûÁ÷Ë͸ø±àÒëÆ÷¡£±àÒëÆ÷ÔÙµÚ¶þ´Î½«Õâ¸öÁ÷»®·ÖΪ¼ÇºÅ¡£
    ÔÚÕâÒ»½ÚÖУ¬ÎÒÃǽ«Ì½Ë÷¶Ô¼ÇºÅµÄÒâÒåµÄÆÕ±éµÄÎó½âÒÔ¼°¼ÇºÅºÍ×é³ÉËüÃǵÄ×Ö·ûÖ®¼äµÄ¹Øϵ¡£ÉÔºóÎÒÃǽ«Ì¸µ½Ô¤´¦ÀíÆ÷¡£
1.1 = ²»ÊÇ ==
    ´ÓAlgolÅÉÉú³öÀ´µÄÓïÑÔ£¬ÈçPascalºÍAda£¬ÓÃ:=±íʾ¸³Öµ¶øÓÃ=±íÊ


Ïà¹ØÎĵµ£º

C±à³Ì¾«´â

¹æÔò»ò½¨Ò顣ÿÌõ×¼Ôò¶¼ÓÐÀýÍâ
1£¬¼ÙÏëµÄ±àÒë³ÌÐò
ʹÓñàÒë³ÌÐòËùÓеĿÉÑ¡¾¯¸æÉèÊ©
ʹÓÃlintÀ´²é³ö±àÒë³ÌÐò©µôµÄ´íÎó
Èç¹ûÓе¥Ôª²âÊÔ£¬¾Í½øÐе¥Ôª²âÊÔ
2£¬×Ô¼ºÉè¼Æ²¢Ê¹ÓöÏÑÔ
¼ÈҪά»¤³ÌÐòµÄ½»¸¶°æ±¾£¬ÓÖҪά»¤³ÌÐòµÄµ÷ÊÔ°æ±¾
ҪʹÓöÏÑÔ¶Ôº¯Êý²ÎÊý½øÐÐÈ·ÈÏ
Òª´Ó³ÌÐòÖÐɾȥÎÞ¶¨ÒåµÄÌØÐÔ£¬»òÕßÔÚ³ÌÐòÖÐʹÓöÏÑÔÀ´¼ ......

[ת]C/C++µÄ64λÕûÐÍ

Technorati ±êÇ©: C++ Ô­ÎĵØÖ·£ºhttp://www.byvoid.com/blog/c-int64/ ÔÚC/C++ÖУ¬64ΪÕûÐÍÒ»Ö±ÊÇÒ»ÖÖûÓÐÈ·¶¨¹æ·¶µÄÊý¾ÝÀàÐÍ¡£ÏÖ½ñÖ÷Á÷µÄ±àÒëÆ÷ÖУ¬¶Ô64ΪÕûÐ͵ÄÖ§³ÖÒ²ÊDZê×¼²»Ò»£¬ÐÎ̬¸÷Òì¡£Ò»°ãÀ´Ëµ£¬64λÕûÐ͵Ķ¨Ò巽ʽÓÐlong longºÍ__int64Á½ÖÖ(VC»¹Ö§³Ö_int64)£¬¶øÊä³öµ½±ê×¼Êä³ö·½Ê½ÓÐprintf(¡°%lld¡±,a)£¬printf ......

(ת£©Ñ§Ï°c/c++µÄ50¸öºÃÍøÕ¾

1¡¢http://snippets.dzone.com/tag/c/ --ÊýÒÔǧ¼ÆµÄÓÐÓõÄCÓïÑÔÔ´´úÂëƬ¶Î
2¡¢http://www.hotscripts.com/category/c-cpp/scripts-programs/ Hotscripts --ÌṩÊýÒ԰ټƵÄCºÍC++½Å±¾ºÍ³ÌÐò¡£ËùÓгÌÐò¶¼·ÖΪ²»Í¬µÄÀà±ð¡£
3¡¢http://www.planetsourcecode.com/vb/default.asp?lngWId=3 --³¬¹ýÍòÐÐCºÍC++Ãâ·ÑµÄÔ´´úÂë
4¡ ......

¡¶Cר¼Ò±à³Ì¡·Ñ§Ï°×ܽá2


¡¶Cר¼Ò±à³Ì¡·Ñ§Ï°×ܽá2
 
ת×Ô £º http://blog.chinaunix.net/u2/87570/showart_2120069.html
±àÒëÆ÷×öÁËЩʲô
 
                 ͼ1£º±àÒëÆ÷ͨ³£·Ö¸î³É¼¸¸ö¸üСµÄ³ÌÐò
 
¾²Ì¬Á´½ÓÓ붯̬Á´½Ó
 
  ......

C' Fragment

°ÑÊäÈëµÄÒ»´®×Ö·ûת³ÉÊý×飬ת³ÉÁ´±í£¬È»ºóɾȥÆäÖÐÖ¸¶¨µÄ×Ö·û£¬ÔÚβ²¿Ìí¼ÓÒ»¸ö×Ö·û¡£
£¨³ÌÐò»¹²»ÍêÉÆ£¬Ã»ÓжÔÊä´íµÄÇé¿ö½øÐд¦Àí£¬£¬ÔÝʱÏÈÕâÑù°É¡£¡£= =¡££©
#include<stdio.h>
#include<malloc.h>
#define LEN sizeof(struct link)
struct link
{
char ch;
struct link *next;
}*string;
char a ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ