注意,以下声明是不同的哦
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
***************************************
***************************************
函数的局部声明可以屏蔽其他的重载的函数声明。
对编译器的名称解析有重大影响。
***************************************
***************************************
***************************************
***************************************
***************************************
***************************************