注意,以下聲明是不同的哦
int *matrix[10]; // array of 10 pointers
int (*matrix)[10]; // pointer to an array of 10 ints
因爲[]的優先級要比*的優先級高。
***************************************
***************************************
const 不能作爲函數重載的差異。
例如:
int test( int t );
int test( const int t );
gcc 會報 “函數重定義”。
但應參與const 形參的等價性僅適用於 非引用形參
對於引用參數,指針參數,const能作爲重載的差異。
注意: 不能給予指針本身是否爲const來實現函數重載。
void f(int *);
void f(int *const); // redeclaration
***************************************
***************************************
函數的局部聲明可以屏蔽其他的重載的函數聲明。
對編譯器的名稱解析有重大影響。
***************************************
***************************************
***************************************
***************************************
***************************************
***************************************