C ±à³Ì×î¼Ñʵ¼ù
¼ò½é
±¾ÎÄÊÇΪÁËÂú×㿪·¢ÈËÔ±µÄÐèÒª¶øдµÄ¡£ÎÒÃÇ×ܽáÁËÒ»Ì×Ö¸ÄÏ£¬ÎÞÂÛ×÷Ϊ¿ª·¢ÈËÔ±»¹ÊǹËÎÊ£¬ÕâЩָÄ϶àÄêÀ´Ò»Ö±¶¼ºÜºÃµØÖ¸µ¼×ÅÎÒÃÇ£¬ÎÒÃÇ°ÑËüÃÇ×÷Ϊ½¨ÒéÌṩ¸øÄú£¬Ï£Íû¶ÔÄúµÄ¹¤×÷ÓÐËù°ïÖú¡£ÄúÒ²Ðí²»ÔÞͬÆäÖеÄijЩָÄÏ£¬µ«ÎÒÃÇÏ£ÍûÄú»áϲ»¶ÆäÖеÄһЩ²¢ÔÚÄúµÄ±à³Ì»òÒÆÖ²ÏîÄ¿ÖÐʹÓÃËüÃÇ¡£
·ç¸ñÓëÖ¸ÄÏ
ʹÓÃÒ»ÖÖʹ´úÂë¾ßÓпɶÁÐÔºÍÒ»ÖÂÐÔµÄÔ´´úÂë·ç¸ñ¡£Èç¹ûûÓÐÍŶӴúÂë·ç¸ñ»ò×Ô¼ºµÄ·ç¸ñ£¬Äú¿ÉÒÔʹÓÃÓë´ó¶àÊý C ³ÌÐòÔ±²ÉÓÃµÄ Kernighan ºÍ Ritchie ·ç¸ñÏàËƵķç¸ñ¡£È»¶ø£¬¾ÙÒ»¸ö¼«¶ËµÄÀý×Ó£¬ÓпÉÄÜ×îÖÕ»áд³öÓëÏÂÃæÏàËƵĴúÂ룺
int i;main(){for(;i["]<i;++i){--i;}"];read('-'-'-',i+++"hell\
o, world!\n",'/'/'/'));}read(j,i,p){write(j/p+p,i---j,i/i);
— 1984 ÄêÄ£ºý C ´úÂë´óÈü“²î¾¢½±”¡£Ó¦´úÂë×÷ÕßÒªÇóÄäÃû¡£
ͨ³£½«Ö÷Àý³Ì¶¨ÒåΪ main()¡£¶ÔÓ¦µÄ ANSI ±àд·½Ê½ÊÇ int main(void)£¨Èç¹û²»¿¼ÂÇÃüÁîÐвÎÊýµÄ»°£©»ò int main( int argc, char **argv )¡£ANSI ÒÔÇ°µÄ±àÒëÆ÷»áÊ¡ÂÔ voidÉùÃ÷£¬»òÁгö±äÁ¿ÃûÒÔ¼°½ôËæÆäºóµÄÉùÃ÷¡£
¿Õ¸ñ
³ä·ÖÀûÓÃˮƽºÍ´¹Ö±¿Õ¸ñ¡£Ëõ½øºÍ¿Õ¸ñ¼ä¾àÓ¦·´Ó³³ö´úÂëµÄ¿é½á¹¹¡£
Ó¦½«Ìõ¼þÔËËã·ûµÄ³¤×Ö·û´®·Ö¸î³Éµ¥¶ÀµÄ¼¸ÐС£ÀýÈ磺
if (foo->next==NULL && number < limit && limit <=SIZE
&& node_active(this_input)) {...
×îºÃ¸Ä³É£º
if (foo->next == NULL
&& number < limit && limit <= SIZE
&& node_active(this_input))
{
...
ͬÑù£¬Ó¦½«ÃèÊöµÃºÜÏêϸµÄ for Ñ»··Ö¸î³É²»Í¬µÄÐУº
for (curr = *varp, trail = varp;
curr != NULL;
trail = &(curr->next), curr = curr->next )
{
...
¶ÔÓÚÆäËü¸´ÔÓ±í´ïʽ£¨ÈçʹÓÃÈýÔªÔËËã·û ?:µÄ±í´ïʽ£©£¬×îºÃÒ²½«Æä·Ö¸î³ÉÊýÐС£
z = (x == y)
? n + f(x)
: f(y) - n;
×¢ÊÍ
×¢ÊÍÓ¦ÃèÊöÕýÔÚ·¢ÉúʲôÊ¡¢ÈçºÎÍê³ÉËü¡¢²ÎÊý±íʾʲô¡¢Ê¹ÓÃÁËÄÄЩȫ¾Ö±äÁ¿ÒÔ¼°ÈκÎÏÞÖÆ»ò´íÎó¡£µ«Òª±ÜÃâ²»±ØÒªµÄ×¢ÊÍ¡£Èç¹û´úÂë±È½ÏÇåÎú£¬²¢ÇÒʹÓÃÁËÁ¼ºÃµÄ±äÁ¿Ãû£¬ÄÇôËüÓ¦¸ÃÄܹ»½ÏºÃµØ˵Ã÷×ÔÉí¡£ÒòΪ±àÒëÆ÷²»¼ì²é×¢ÊÍ£¬ËùÒÔ²»±£Ö¤ËüÃÇÊÇÕýÈ·µÄ¡£Óë´úÂë²»Ò»ÖµÄ×¢ÊÍ»áÆðµ½Ïà·´µÄ×÷Ó᣹ý¶àµÄ×¢ÊÍ»á
Ïà¹ØÎĵµ£º
[root@ocsser file]# cat array-05.c
//this is a program for two juzheng xiangcheng.
#include <stdio.h>
int main(){
int i,j,m,n;
int g,k,f;
int c[5][6];
& ......
1.¸ÅÂÛ
¡¡¡¡ÔËÐÐʱ¿âÊdzÌÐòÔÚÔËÐÐʱËùÐèÒªµÄ¿âÎļþ£¬Í¨³£ÔËÐÐʱ¿âÊÇÒÔLIB»òDLLÐÎʽÌṩµÄ¡£CÔËÐÐʱ¿âµ®ÉúÓÚ20ÊÀ¼Í70Äê´ú£¬µ±Ê±µÄ³ÌÐòÊÀ½ç»¹ºÜµ¥´¿£¬Ó¦ÓóÌÐò¶¼Êǵ¥Ï̵߳ģ¬¶àÈÎÎñ»ò¶àÏ̻߳úÖÆÔÚ´Ëʱ»¹ÊôÓÚйÛÄî¡£ËùÒÔÕâ¸öjʱÆÚµÄCÔËÐÐʱ¿â¶¼Êǵ¥Ï̵߳ġ£
¡¡¡¡Ëæ×ŲÙ×÷ϵͳ¶àÏ̼߳¼ÊõµÄ·¢Õ¹£¬×î³õµÄCÔËÐÐʱ¿âÎÞ·¨Âú×ã³ÌÐò ......
¶ÔÓÚÒ»¸öc/c++³ÌÐòÔ±À´Ëµ£¬ÄÚ´æй©ÊÇÒ»¸ö³£¼ûµÄÒ²ÊÇÁîÈËÍ·ÌÛµÄÎÊÌâ¡£ÒѾÓÐÐí¶à¼¼Êõ±»Ñо¿³öÀ´ÒÔÓ¦¶ÔÕâ¸öÎÊÌ⣬±ÈÈçSmart Pointer£¬Garbage CollectionµÈ¡£Smart Pointer¼¼Êõ±È½Ï³ÉÊ죬STLÖÐÒѾ°üº¬Ö§³ÖSmart PointerµÄclass£¬µ«ÊÇËüµÄʹÓÃËƺõ²¢²»¹ã·º£¬¶øÇÒËüÒ²²»Äܽâ¾öËùÓеÄÎÊÌ⣻Garbage Collection¼¼ÊõÔÚJavaÖÐÒѾ ......
4.2 ¶à½Ç¶È±£Ö¤²âÊÔЧ¹û
¶ÔÓÚ´úÂëÖÊÁ¿ÒªÇóºÜ¸ßµÄÏîÄ¿À´Ëµ£¬½öÓа׺и²¸ÇÊÇÔ¶Ô¶²»¹»µÄ¡£°×ºÐ¸²¸Ç²»ÄÜ·¢ÏÖ´úÂëȱʧ£¬°×ºÐ¸²¸Ç»ùÓÚÏÖÓдúÂ룬Èç¹û´úÂë²»´æÔÚ£¬µ±È»²»ÄÜ·¢ÏÖ¡£ÎªÁ˼ì²â´úÂëȱʧ£¬ÐèÒªÈ˹¤¶Ô²âÊÔÊý¾Ý½øÐмì²é¡£°×ºÐ¸²¸ÇÒ²²»ÄÜ·¢ÏÖÓÃÀýδ·´Ó³¹¦ÄÜ¡£Èç¹ûÉè¼ÆÓÃÀýʱ£¬²âÊÔÔ±²»Á˽â´úÂëµÄ¹¦ÄÜ£¬Í ......
ÓÅ»¯C´úÂë³£Óõļ¸ÕÐ
ÔÚÐÔÄÜÓÅ»¯·½ÃæÓÀԶעÒâ80-20ÔÔò£¬¼´20%µÄ³ÌÐòÏûºÄÁË80%µÄÔËÐÐʱ¼ä£¬Òò¶øÎÒÃÇÒª¸Ä½øЧÂÊ£¬×îÖ÷ÒªÊÇ¿¼ÂǸĽøÄÇ20%µÄ´úÂë¡£²»ÒªÓÅ»¯³ÌÐòÖпªÏú²»´óµÄÄÇ80%£¬ÕâÊÇÀͶøÎÞ¹¦µÄ¡£
µÚÒ»ÕУºÒԿռ任ʱ¼ä
¼ÆËã»ú³ÌÐòÖÐ×î´óµÄì¶ÜÊÇ¿Õ¼äºÍʱ¼äµÄì¶Ü£¬ÄÇô£¬´ÓÕâ¸ö½Ç¶È³ö·¢ÄæÏò˼άÀ´¿¼ÂdzÌÐòµÄЧÂÊÎÊÌ⣬ÎÒ ......