c ÓïÑÔº¯Êý´«²ÎµÄÈýÖÖ·½Ê½¼°¶þ¼¶Ö¸ÕëµÄÀí½â
ÆÕͨ±äÁ¿ÊÇÖ±½Ó´«Öµshow(int a,int b)
Ö¸Õë±äÁ¿´«µÝµØÖ·show(int *a,int *b)
ÒýÓñäÁ¿ÊÇÒþʽ´«µØÖ· 1:int x;void show(int &x)£¬Êµ¼Ê´«µÝµÄÊÇxµÄµØÖ·p£¬µ«ÊǺ¯ÊýÄÚ²¿Ê¹ÓÃxʱ»á×Ô¶¯±ä³É*p
void f(int &x) {x++}; »á±ä³É
void f(int *p) {(*p)++};
2:int *x;void show(int &x),ʵ¼ÊÒѾ¹¹³ÉÁ˶þ¼¶Ö¸Õë¡£
¶Ô¶þ¼¶Ö¸ÕëµÄÉîÈëÀí½â£ºº¯Êý¼äµÄÖ¸ÕëÒýÓûò´«µÝ£¬ÆäʵÖÊÒ²ÊǶԵØÖ·µÄ¿½±´£¬¼´×öÁËÁ˸±±¾·ÅÔÚÒýÓõĺ¯ÊýÀï¡£
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
void jj(int **p1){
int a=60;
int *pt;
printf("%d\n",p1);
printf("%d\n",*p1);
printf("%d\n",**p1);
pt=&a;
p1=&pt;
printf("%d\n",p1);
printf("%d\n",*p1);
printf("%d\n",**p1);
}
main(){
int n=5;
int *p=&n;
jj(&p);
printf("%d\n",*p);
}
Ïà¹ØÎĵµ£º
Precedence Operator Description Example Overloadable Associativity
1
::
Scope resolution operator
Class::age = 2;
no
none
2
()
()
[]
->
.
++
--
const_cast
dynamic_cast
static_cast
reinterpret_cast
typeid
Function call
Member initalization
Array access
Member access from ......
1¡¢bool¡¢float¡¢Ö¸Õë±äÁ¿Óë"ÁãÖµ"±È½ÏµÄifÓï¾ä£¿
´ð£º
bool flag; if(flag)£¬if(!flag)
char *p; if(p==NULL)£¬if(p!=NULL)
float x;
const float EPSILON = 1e-6;
if((x>=-EPSILON)&&(x<=EPSILON)) //(-0.000001~0.000001)
if((x<-EPSILON)&& ......
×î½üÔÚcsdnµÄÂÛ̳ÉÏ·¢ÁËÕâÑùÒ»¸öÌû×ÓÈçÏÂ
int a=5;
a*=a/=a++;
ÎÒÔÚÒ»±¾¶þ¼¶cµÄÊéÉÏ¿´µ½µÄ´ð°¸ÊÇ2 ÓÉÓÚÎÒ¶Ô´ËÌâ²¢²»ÊÇÊ®·ÖÀí½â ËùÒÔÔÚÂÛ̳ÉÏ·¢±í ¿´ÓÐûÓÐÈËÄܰï׎âÊÍһϠȴûÓÐÏëµ½ÒýÀ´µÄ40¶àÂ¥µÄÒ»¸ö³¤Ìù ÒÔÖÁÓÚµ½×îºóÌÖÂÛµÄÄÚÈÝÔ¶Ô¶³¬¹ýµÄÌâÄ¿±¾Éí ÕæÊµ²»½â,ΪʲôÕâôÓÐÕùÒéµÄÌâÈ´ÄÃÀ´¿¼ÈË,Äѵ½¶¼Òª°´¶þ¼¶cµÄvc±àÒ ......
Ò»Ö±¶Ô½á¹¹ÌåŪµÄÄ£ºý£¬½ñÌìÖÕÓÚÓлú»á³ÎÇåÁË¡£Óиö´í£º²»Ã÷°×ûÓнṹÌåÃûµÄ½á¹¹ÌåÈçºÎÏñ½á¹¹ÌåÃûÒ»ÑùʹÓá£
typedf struct st ......