¹ØÓÚ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 ......
ÔÚ¸ùĿ¼/libÖдæ·ÅÒ»¸ölog.c£¬log.h£¬²¢ÓÃÏÂÃæµÄÓï¾ä£º
gcc -c log.c
ar crv liblog.a log.o
±àÒë³öÒ»¸öliblog.a¾²Ì¬¿â£¬È»ºóÔÚÎļþ¼Ð£º/testfileÖд´½¨Ò»¸ötest.cºÍtestc.c£¬test.cÖÐÒýÓÃÁËtestc.cÖж¨ÒåµÄ·½·¨ ......
ΪʲôÎҵijÌÐòµ÷ÓÃXMLÅäÖÃÎļþÖеİ¢À²®ÎÄÏÔʾ²»³öÀ´£¿ÆäËûµÄÓïÖÖ¶¼¿ÉÒÔ£¬ÈçÖÐÎÄ£¬Ó¢ÎÄ£¬µÂÎͼ¿É¡£
ÎÒ½«XMLµÄ±àÂë¸ÄΪutf-8ºÍunicodeµÄµ½µÃ½á¹û¶¼Ò»Ñù.
°¢À²®ÎĵÄ×Ö¿âÄãÓÐô£¿
ÓÐ,ÎÒµÄEXEÊÇ·ÅÔÚpc»úÉÏÖ´Ðе ......
[align=center][/align]CÓïÑÔÖÐÈçºÎÅжÏÒ»¸ödoubleÐ͵ÄÊý×飨Èçdouble S[20]£»£©ÊÇÒ»¸ö¿ÕÊý×飬¼´Êý×éÖÐûÓзÅÈκÎÖµ¡£
û°ì·¨¡£
"ÈκÎÖµ" µÄ¶¨Òå?
¾ÍÊÇÊý×éÊǿյģ¬Ã»ÓÐΪËü¸³Öµ
¿ÉÒÔ¿¼Â ......