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

C¿ª·¢ÖжѺÍÕ»µÄ²î±ð

1£¬Õ»Çø£¨stack£©—   ÓɱàÒëÆ÷×Ô¶¯·ÖÅäÊÍ·Å£¬´æ·Åº¯ÊýµÄ²ÎÊýÖµ£¬¾Ö²¿±äÁ¿µÄÖµµÈ¡£Æä²Ù×÷·½Ê½ÀàËÆÓÚÊý¾Ý½á¹¹ÖеÄÕ»¡£ ÀýÈ磬ÉùÃ÷ÔÚº¯ÊýÖеÄÒ»¸ö¾Ö²¿±äÁ¿int b£»ÏµÍ³×Ô¶¯ÔÚÕ»ÖÐΪb¿ª±Ù¿Õ¼ä¡£Ö»ÒªÕ»µÄÊ£Óà¿Õ¼ä´óÓÚËùÉêÇë¿Õ¼ä£¬ÏµÍ³½«Îª³ÌÐòÌṩÄڴ棬·ñÔò½«±¨Òì³£ÌáʾջÒç³ö¡£±ÈÈ磺
char* AllocStrfromStack()
{
¡¡¡¡¡¡¡¡char pstr[100];
¡¡¡¡¡¡¡¡return pstr;        //ÓÃÊý×éÄ£ÄâÕ»
}
¶ÔÓڸú¯Êý£¬ÄÇ¿épstrµÄÄÚ´æÔÚº¯Êý·µ»Øʱ¾Í±»ÏµÍ³ÊÍ·ÅÁË£¬Ö»ÔÚº¯ÊýÄÚ²¿µ÷ÓÃʱ²ÅÓУ¬Æäʵ·µ»ØµÄchar*ʲôҲûÓС£
      Ϊ´Ë×ö¹ýÒ»¸öʵÑ飺
#include "stdafx.h"
#include "string.h"
char * AddReturn()
{
     char s[]="abcdef"; 
     unsigned char n=sizeof(s)/sizeof(char);
     printf("%d\n",n); //7
     printf("%d\n",strlen(s)); //6
     for(unsigned char  i=0;i<n;i++)
           printf("%c",s[i]);
     printf("\n");
     return s; //·µ»ØµØÖ·ºó£¬¾Í²»ÔÚÊÇ×Ö·û´®µØÖ·ÁË£¬ÒòΪÊǾֲ¿±äÁ¿£¬ÔÚÕ»ÖÐ
}
int main(int argc, char* argv[])
{
     char *u;
     u=AddReturn(); //·µ»ØÁËÒ»¸öÖµ£¬µ«ÊÇÎÞЧµÄ¡£
     for(unsigned char i=0;i<7;i++);
         printf("%c",u[i]); //Êä³öµÄÊÇÂÒÄÚÈÝ 
     return 0;
}
ÔÚWindowsÏ£¬Õ»ÊÇÏòµÍµØÖ·À©Õ¹µÄÊý¾Ý½á¹¹£¬ÊÇÒ»¿éÁ¬ÐøµÄÄÚ´æµÄÇøÓò¡£Õâ¾ä»°µÄÒâ˼ÊÇÕ»¶¥µÄµØÖ·ºÍÕ»µÄ×î´óÈÝÁ¿ÊÇϵͳԤÏȹ涨ºÃµÄ£¬Èç¹ûÉêÇëµÄ¿Õ¼ä³¬¹ýÕ»µÄÊ£Óà¿Õ¼äʱ£¬½«Ìáʾoverflow¡£
2£¬¶ÑÇø£¨heap£© —   Ò»°ãÓɳÌÐòÔ±·ÖÅäÊÍ·Å£¬ Èô³ÌÐòÔ±²»ÊÍ·Å£¬³ÌÐò½áÊøʱ¿ÉÄÜÓÉOS»ØÊÕ¡£×¢ÒâËüÓëÊý¾Ý½á¹¹ÖеĶÑÊÇÁ½»ØÊ£¬·ÖÅ䷽ʽµ¹ÊÇÀàËÆÓÚÁ´±í¡£¿ÉÄÜÓõ½µÄ¹Ø¼ü×ÖÈçÏ£ºnew¡¢malloc¡¢delete¡¢freeµÈµÈ¡£ÔÚcÖÐmallocº¯ÊýÈçp1 = (char *)malloc(10)£»µ«ÊÇ×¢Òâp1±¾ÉíÊÇÔÚÕ»Öеģ¬ÒòΪËûÃÇ»¹ÊÇ¿ÉÒÔÈÏΪÊǾֲ¿±äÁ¿¡£±ÈÈ磺
ch


Ïà¹ØÎĵµ£º

unix cѧϰָÄÏ (Êé¼®,ѧϰ·½·¨µÈ)

ÒýÑÔ
¾¡¹Ü C ÓïÑÔÎÊÊÀÒѽü 30 Ä꣬µ«ËüµÄ÷ÈÁ¦ÈÔδ¼õÍË¡£C ÓïÑÔ¼ÌÐøÎüÒý×ÅÖÚ¶àµÄ¿ª·¢Õߣ¬ËûÃÇΪÁ˱àд¡¢ÒÆÖ²»òά»¤Ó¦ÓóÌÐò¶ø±ØÐëѧϰм¼ÄÜ¡£
±¾ÎÄÊÇΪÁËÂú×ã¶ÔCÓïÑÔ³õѧÕß»òÏëÌá¸ß×ÔÉíCÓïÑÔÐÞΪµÄ¿ª·¢ÈËÔ±µÄÐèÒª¶øдµÄ¡£Ï£Íû¶ÔÄúµÄѧϰºÍ¹¤×÷ÓÐËù°ïÖú¡£ÄúÒ²Ðí²»ÔÞͬÆäÖеÄijЩ·½·¨£¬µ«ÎÒÃÇÏ£ÍûÄú»áϲ»¶ÆäÖеÄһЩ¡£
±¾Î ......

Ö¸Õë±äÁ¿µÄ¶¨ÒåºÍ³õʼ»¯[c][code]


Ô­Ìû£º
http://hi.baidu.com/pepsi360/blog/item/cc74be4412cf6789b3b7dcd4.html
#include <stdio.h>
struct Node
{
    int a;
    char b[10];
     Node *next;
};
main(void)
{
    char   *p=NUL ......

My emacs color theme for c and c++

ÔÚÕâ¶ùÏÂÔØ£ºcolor-theme
:
http://download.savannah.gnu.org/releases-noredirect/color-theme/
wget http://download.savannah.gnu.org/releases-noredirect/color-theme/color-theme-6.6.0.tar.gz
tar zxf color-theme-6.6.0.tar.gz -C ~/.emacs.d
ÔÚ.emacsÖмÓÈëÏÂÁÐÓï¾ä£º
;; corlor-theme ......

¸øCÅ̼õ¼õ·Ê,ÈÃÄãµçÄÔ·ÉÒ»°ãËÙ¶È

µ±ÄãÂòÁĘ̈еçÄÔʱ£¬¾õµÃÐÔÄÜ£¬Ëٶȣ¬Ä㶼±È½ÏÂúÒ⣬µ«ÊÇËæ×Åʱ¼äÍÆÒÆ£¬Äã¾õµÃÄãCÅÌ¿Õ¼äÔ½À´Ô½Ð¡£¬ËÙ¶ÈÒ²½µÏÂÁË£¬ÄÇÎÒÃǸÃÔõô°ìÄØ£¿
     ¶ÔÓÚ²ËÄñÀ´Ëµ£¬ÓÐÒ»µãÄã±ØÐë×¢Ò⣺µ±ÄãÏÂÔض«Î÷£¬ÓÐЩÍøÕ¾ÊÇĬÈÏCÅÌ£¬Õâʱ¿ÉÒÔÑ¡ÔñÏÂÔØÅÌʱ£¬×îºÃ·ÅÔÚÆäËûÅÌÀ²»¿ÉÒÔÑ¡ÔñҲû°ì·¨£¬CÅÌÀïµÄÎļþÒ²ÊDz¡¶¾Ï²»¶ ......

ÓÃEclipse´î½¨C/C++¿ª·¢Æ½Ì¨

̸µ½EclipseÕâ¸ö¿ªÔ´IDE£¬´ó¼Ò¶¼»áDZÒâʶµØ°ÑËüºÍJAVA¿ª·¢ÁªÏµÆðÀ´¡£Ã»´í£¬EclipseÓÃÓÚJAVA applicationµÄ¿ª·¢ÊÇÄ¿Ç°µÄÖ÷Á÷£¬¶øÇÒËü±¾ÉíÒ²ÊÇÐèÒªJRE²ÅÄÜÔËÐеģ¬Òò¶øÎÞÂÛÔõô¿´Eclipse¶¼ÓëJAVAÓÐÃܲ»¿É·ÖµÄÁªÏµ¡£ µ«Êµ¼ÊÉÏEclipseÖ»ÊÇÒ»¸ö¿ª·¢»·¾³£¬Ò»¸öΪ³ÌÐòÔ±ÌṩµÄ¿ò¼Ü£¬ÓëÓïÑÔ²¢ÎÞÖ±½ÓÁªÏµ¡£×Ô´Ó2001ÄêIBM½«Eclipse¾èÏ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ