¹ØÓÚC¼¸¸öÖ¸ÕëµÄÎÊÌâ——Çë°ïæ½â»ó
1.Ϊʲô¶¨Ò庯Êýʱ£ºfun1 ¿ÉÒÔÕýÈ·µÄ·µ»Ø¶øfun2²»ÐУ¿
char * fun1()
{
char *p = "haha";
return p;
}
char * fun2()
{
char p[] = "haha";
return p;
}
ÊÇ·ñ¿ÉÒÔÕâÑùÀí½â£º
fun1ÖÐpÊÇÒ»¸ölocalµÄ±äÁ¿£¬ËüÖ¸ÏòÒ»¸ö¿Õ¼ä£¬¿Õ¼äÖд洢ÓÐhaha£¬º¯Êý½áÊøʱpÕâ¸ö±äÁ¿±»destroyµô£¬¶øËüÖ¸ÏòµÄ¿Õ¼ä»¹ÊÇÓÐÊý¾ÝûÓб»Ïú»Ù,¸ø³£Á¿×Ö·û´®·ÖÅäµÄ¿Õ¼äÓÐʲô²»Í¬£¬ÊÇ·ñÊDZàÒëʱ·ÖÅä¶ø²»ÊÇÔÊÐíʱ·ÖÅ䣬ËùÒÔÕⲿ·ÖÄÚÈÝÒ»Ö¶¼ÓУ¿
¶øfun2Öиøp·ÖÅäÒ»¿é¿Õ¼ä×°haha£¬º¯Êý½áÊøÕâ¿é±»·ÖÅäµÄ¿Õ¼ä±»Êջأ¬ÀïÃæµÄÄÚÈÝÒ²¾ÍûÓÐÁË¡£
2.¹ØÓÚ¶àάÊý×éµÄÎÊÌ⣺
void fun3()
{
char p[][4] = {"11","22","33","44"};
printf("%s",p+1);//Õâ¸ö¿ÉÒÔÊä³ö22
printf("%s",*(p+1));//Õâ¸ö¿ÉÒÔÊä³ö22
printf("%s",p[1][4]);//ΪʲôÕâ¸ö´íÎó*(p+1)²»¾ÍÊÇp[1][4]Â
}
http://blog.163.com/yan_zhennan@126/blog/static/10934475020098128952406/
**(p+1)ÊÇp[1][0]
printf("%s",p[1][4]);//ΪʲôÕâ¸ö´íÎó*(p+1)²»¾ÍÊÇp[1][4]Â
·´ÕýÔ½½çÁË¡£ http://blog.163.com/xuchaoyang88/blog/static/17339733200981525955103/
char *p = "haha"; ¡°haha"´æ´¢ÔÚ³£Á¿Çø£¬³ÌÐò½áÊø²ÅÊÍ·Å
char p[] = "haha"; ´æ´¢ÔÚÕ»ÉÏ£¬º¯Êý½áÊø¾ÍûÁË
p[1][4]ÊÇ×Ö·û£¬ÓÃ%c
¶ÔÓÚÊý×éÔªËØa[i][j
Ïà¹ØÎÊ´ð£º
ÈçÌ⣬C/C++ÖеÄexeclÔõôµ÷ÓÃдºÃµÄjava³ÌÐò£¬
execl("/opt/java1.5/bin/java","MyClass",NULL);
ÕâÑùµÄ²»ÐÐŶ¡£
²»»á.
ÔËÐÐjava³ÌÐò
ÕÒ¹¤¾ß²é¿´Ò»ÏÂÄǸö³ÌÐòµÄÃüÁîÐÐ
ËÑË÷Ï£ºjni ......
ÔھƵê¹ÜÀíϵͳÖÐ,ÓÐÒ»¸ö¶ÔÄÚµÄϵͳ,¹©Ç°Ì¨·þÎñÔ±ºÍ¾ÀíʹÓÃ
»¹ÓÐÒ»¸ö¾ÍÊǶÔÍâ,Èÿͻ§¿ÉÒÔÔÚÍøÉÏÔ¤¶©·¿¼ä,
ËüÃÇÖ®¼äÊÇÔõôͨѶµÄ.?µ±ÎÒÌá½»Ô¤¶©·¿¼äÐÅÏ¢µÄʱºò,
ÔÚ¶ÔÄÚµÄϵͳÖÐ,ÈçºÎÖªµÀÎÒÒѾÌá½»ÁËÐÅÏ¢¹ýÈ¥.Ê¹Ç ......
Ï£Íû¸ø´ó¼ÒÌṩһЩеÄ˼·.
ÎÒÃÇÔÚʹÓÃC±à³Ìʱ»áÓöµ½Ò»¸öÎÊÌ⣬±ÈÈçÍ·ÎļþµÄÒ»¸öº¯Êý°üº¬ÔÚÒ»¸ölib ÖУ¬µ«ÊÇ
ÔÚʵ¼ÊÁ¬½ÓÖÐÎÒÃDz»ÖªµÀËüÔÚÄĸö¿âÖС£Ò²Ðí¿ÉÐеÄÒ»ÖÖ°ì·¨ÊÇÖ±½ÓÉÏÍø²éѯij¸ö
º¯ÊýµÄÒÀÀµÌõ¼þ£¬Õâ¶Ô ......
´ó¼ÒºÃ£¬ÎÒÊÇÐÂÊÖ£¬¸Õ¿ªÊ¼½Ó´¥C/S½á¹¹µÄ³ÌÐò£¬ÏëҪʵÏÖÒ»¸ö·ÖÒ³¹¦ÄÜ£¬´ó¼ÒÓÐûÓкõãµÄ·ÖÒ³¿Ø¼þ»òÕß³ÌÐòÖ®ÀàµÄ£¬µ±È»Ô´³ÌÐò¸üºÃ£¬·ñÔò˵˵Á÷³ÌÒ²¿ÉÒÔ£¬Ð¡Ãü±°¡£¬ÔÚÏߵȡ£¡£¡£¡£
´ó¼Ò°ï°ï棬ллÁË£¬¼±¡£¡£¡£
Ä ......
[align=center][/align]CÓïÑÔÖÐÈçºÎÅжÏÒ»¸ödoubleÐ͵ÄÊý×飨Èçdouble S[20]£»£©ÊÇÒ»¸ö¿ÕÊý×飬¼´Êý×éÖÐûÓзÅÈκÎÖµ¡£
û°ì·¨¡£
"ÈκÎÖµ" µÄ¶¨Òå?
¾ÍÊÇÊý×éÊǿյģ¬Ã»ÓÐΪËü¸³Öµ
¿ÉÒÔ¿¼Â ......