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

cÖ¸ÕëÏê½â

 µÚÒ»Õ ¸ÅÄî
Ö¸ÕëÊÇÒ»¸öÌØÊâµÄ±äÁ¿£¬ËüÀïÃæ´æ´¢µÄÊýÖµ±»½âÊͳÉΪÄÚ´æÀïµÄÒ»¸öµØÖ·¡£Òª¸ãÇåÒ»¸öÖ¸ÕëÐèÒª¸ãÇåÖ¸ÕëµÄËÄ·½ÃæµÄÄÚÈÝ£ºÖ¸ÕëµÄÀàÐÍ£¬Ö¸ÕëËùÖ¸ÏòµÄÀàÐÍ£¬Ö¸ÕëµÄÖµ»òÕß½ÐÖ¸ÕëËùÖ¸ÏòµÄÄÚ´æÇø£¬»¹ÓÐÖ¸Õë±¾ÉíËùÕ¼¾ÝµÄÄÚ´æÇø¡£ÈÃÎÒÃÇ·Ö±ð˵Ã÷¡£
ÏÈÉùÃ÷¼¸¸öÖ¸Õë·Å×Å×öÀý×Ó£º
ÀýÒ»£º
(1)int *ptr;
(2)char *ptr;
(3)int **ptr;
(4)int (*ptr)[3];
(5)int *(*ptr)[4];
Èç¹û¿´²»¶®ºó¼¸¸öÀý×ӵĻ°£¬Çë²ÎÔÄÎÒÇ°¶Îʱ¼äÌù³öµÄÎÄÕ < <ÈçºÎÀí½âcºÍc
++µÄ¸´ÔÓÀàÐÍÉùÃ÷>>¡£
¡¡
1 Ö¸ÕëµÄÀàÐÍ¡£
´ÓÓï·¨µÄ½Ç¶È¿´£¬ÄãÖ»Òª°ÑÖ¸ÕëÉùÃ÷Óï¾äÀïµÄÖ¸ÕëÃû×ÖÈ¥µô£¬Ê£ÏµIJ¿·Ö¾ÍÊÇÕâ¸öÖ¸ÕëµÄÀàÐÍ¡£ÕâÊÇÖ¸Õë±¾ÉíËù¾ßÓеÄÀàÐÍ¡£ÈÃÎÒÃÇ¿´¿´ÀýÒ»Öи÷¸öÖ¸ÕëµÄÀàÐÍ£º
(1)int *ptr; //Ö¸ÕëµÄÀàÐÍÊÇint *
(2)char *ptr; //Ö¸ÕëµÄÀàÐÍÊÇchar *
(3)int **ptr; //Ö¸ÕëµÄÀàÐÍÊÇ int **
(4)int (*ptr)[3]; //Ö¸ÕëµÄÀàÐÍÊÇ int(*)[3]
(5)int *(*ptr)[4]; //Ö¸ÕëµÄÀàÐÍÊÇ int *(*)[4]
ÔõôÑù£¿ÕÒ³öÖ¸ÕëµÄÀàÐ͵ķ½·¨ÊDz»ÊǺܼòµ¥£¿
¡¡
2 Ö¸ÕëËùÖ¸ÏòµÄÀàÐÍ¡£
µ±Äãͨ¹ýÖ¸ÕëÀ´·ÃÎÊÖ¸ÕëËùÖ¸ÏòµÄÄÚ´æÇøʱ£¬Ö¸ÕëËùÖ¸ÏòµÄÀàÐ;ö¶¨Á˱àÒëÆ÷½«°ÑÄÇƬÄÚ´æÇøÀïµÄÄÚÈݵ±×öʲôÀ´¿´´ý¡£
´ÓÓï·¨ÉÏ¿´£¬ÄãÖ»Ðë°ÑÖ¸ÕëÉùÃ÷Óï¾äÖеÄÖ¸ÕëÃû×ÖºÍÃû×Ö×ó±ßµÄÖ¸ÕëÉùÃ÷·û*È¥µô£¬Ê£ÏµľÍÊÇÖ¸ÕëËùÖ¸ÏòµÄÀàÐÍ¡£ÀýÈ磺
(1)int *ptr; //Ö¸ÕëËùÖ¸ÏòµÄÀàÐÍÊÇint
(2)char *ptr; //Ö¸ÕëËùÖ¸ÏòµÄµÄÀàÐÍÊÇchar
(3)int **ptr; //Ö¸ÕëËùÖ¸ÏòµÄµÄÀàÐÍÊÇ int *
(4)int (*ptr)[3]; //Ö¸ÕëËùÖ¸ÏòµÄµÄÀàÐÍÊÇ int()[3]
(5)int *(*ptr)[4]; //Ö¸ÕëËùÖ¸ÏòµÄµÄÀàÐÍÊÇ int *()[4]
ÔÚÖ¸ÕëµÄËãÊõÔËËãÖУ¬Ö¸ÕëËùÖ¸ÏòµÄÀàÐÍÓкܴóµÄ×÷Óá£
Ö¸ÕëµÄÀàÐÍ(¼´Ö¸Õë±¾ÉíµÄÀàÐÍ)ºÍÖ¸ÕëËùÖ¸ÏòµÄÀàÐÍÊÇÁ½¸ö¸ÅÄî¡£µ±Äã¶ÔCÔ½À´Ô½ÊìϤʱ£¬Äã»á·¢ÏÖ£¬°ÑÓëÖ¸Õë½ÁºÍÔÚÒ»ÆðµÄ“ÀàÐÍ”Õâ¸ö¸ÅÄî·Ö³É“Ö¸ÕëµÄÀàÐÍ”ºÍ“Ö¸ÕëËùÖ¸ÏòµÄÀàÐÍ”Á½¸ö¸ÅÄÊǾ«Í¨Ö¸ÕëµÄ¹Ø¼üµãÖ®Ò»¡£ÎÒ¿´Á˲»ÉÙÊ飬·¢ÏÖÓÐЩдµÃ²îµÄÊéÖУ¬¾Í°ÑÖ¸ÕëµÄÕâÁ½¸ö¸ÅÄî½ÁÔÚÒ»ÆðÁË£¬ËùÒÔ¿´ÆðÊéÀ´Ç°ºóì¶Ü£¬Ô½¿´Ô½ºýÍ¿¡£
3 Ö¸ÕëµÄÖµ£¬»òÕß½ÐÖ¸ÕëËùÖ¸ÏòµÄÄÚ´æÇø»òµØÖ·¡£
Ö¸ÕëµÄÖµÊÇÖ¸Õë±¾Éí´æ´¢µÄÊýÖµ£¬Õâ¸öÖµ½«±»±àÒëÆ÷µ±×÷Ò»¸öµØÖ·£¬¶ø²»ÊÇÒ»¸öÒ»°ãµÄÊýÖµ¡£ÔÚ32λ³ÌÐòÀËùÓÐÀàÐ͵ÄÖ¸ÕëµÄÖµ¶¼ÊÇÒ»¸ö32λÕûÊý£¬ÒòΪ32λ³ÌÐòÀïÄÚ´æµØÖ·È«¶¼ÊÇ32볤¡£
Ö¸ÕëËùÖ¸ÏòµÄÄÚ´æÇø¾ÍÊÇ´ÓÖ¸Õë


Ïà¹ØÎĵµ£º

C/C++——С±à̸CÓïÑÔº¯ÊýÄÇЩÊÂ(18)

C³ÌÐòÊÇÓÉÒ»×é»òÊDZäÁ¿»òÊǺ¯ÊýµÄÍⲿ¶ÔÏó×é³ÉµÄ¡£ º¯ÊýÊÇÒ»¸ö×ÔÎÒ°üº¬µÄÍê³ÉÒ»¶¨Ïà¹Ø¹¦ÄܵÄÖ´ÐдúÂë¶Î¡£ÏÂÃæС±àºÍ´ó¼Ò·ÖÏíÏÂCÓïÑÔÖеĺ¯Êý¡£
 
1.     raiseº¯Êý
raiseº¯ÊýµÄ¹¦ÄÜÊÇÏòÕýÔÚÖ´ÐеijÌÐò·¢ËÍÒ»¸öÐźţ¬ÆäÓ÷¨Îª£ºint raise(int sig);³ÌÐòʵÀýÈçÏ£º
#include <signal.h& ......

·´ÕýÇÐÈý½Çº¯ÊýµÄcÔ´´úÂë

ijЩ³¡ºÏ£¬ÈçÓÎÏ·¿ª·¢£¬¹¤³Ì¼ÆËãÖУ¬¿ÉÄÜÐèÒª¼ÆËã·´Èý½Çº¯Êý£¬ÏÂÃæÊǼÆËã·´ÕýÇÐÈý½Çº¯ÊýµÄcÔ´´úÂëʵÀý£º
atan_self(double x)
{
//atan(x)=x-x^3/3+x^5/5-x^7/7+.....(-1<x<1)
//return:[-pi/2,pi/2]
double mult,sum,xx;
sum=0;
if(x==1){
return pi/4;
}
if(x==-1){
return -pi/4;
}
((x&g ......

C/C++ style

 #include <stdio.h>
int main()
{
char *str[] = {"welcome", "to", "fortemedia", "nanjing"};
char **p = str + 1;
str[0] = ( *p++ ) + 2;
str[1] = * ( p + 1 );
str[2] = p[1] + 3;
str[3] = p[0] + ( str[2] - str[1] );
printf ( "%s\n", str[0] );
printf ( ......

C/C++Ì⼯

ת×Ô£º http://hi.baidu.com/elliott_hdu/blog/item/411421dd5bf8dfe977c63876.html
1.ÏÂÁгÌÐòµÄÊä³ö½á¹ûΪ£º(B)
#include<iostream.h>
void main()
{
       char* a[ ] = { "hello", "the", "world"};
       char** pa = a;
 &nbs ......

C/C++Êý×éÃûÓëÖ¸ÕëÇø±ðÉîÈë̽Ë÷

ÒýÑÔ
¡¡¡¡Ö¸ÕëÊÇC/C++ÓïÑÔµÄÌØÉ«£¬¶øÊý×éÃûÓëÖ¸ÕëÓÐÌ«¶àµÄÏàËÆ£¬ÉõÖÁºÜ¶àʱºò£¬Êý×éÃû¿ÉÒÔ×÷ΪָÕëʹÓá£ÓÚÊǺõ£¬ºÜ¶à³ÌÐòÉè¼ÆÕ߾ͱ»¸ãºýÍ¿ÁË¡£¶øÐí¶àµÄ´óѧÀÏʦ£¬ËûÃÇÔÚCÓïÑԵĽÌѧ¹ý³ÌÖÐÒ²´íÎóµÃ¸øѧÉú½²½â£º"Êý×éÃû¾ÍÊÇÖ¸Õë"¡£ºÜÐÒÔË£¬ÎҵĴóѧÀÏʦ¾ÍÊÇÆäÖÐÖ®Ò»¡£Ê±ÖÁ½ñÈÕ£¬ÎÒÈÕ¸´Ò»ÈյؽøÐÐ×ÅC/C++ÏîÄ¿µÄ¿ª·¢£¬¶øÉí±ß» ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ