C++指針的特殊小記

void testfp2(int a) { 
	return; 
}

void *testfp5(int c) {
	void *a = NULL;
	return a;
}

void **testfp3(int a3) {
	void **a = NULL;
	return a;
}

int main(){
        void *(*(*fp1)(int))[10]; /* fp1 void *[10]*(*)(int) */
	void (*fp2[10])(int);     /* fp2 void(*)(int)[10]    */
	void *(*(*fp3)(int));     /* fp3 void * *(*)(int)    */
	void *(*fp4[10])(int);    /* fp4 void *(*)(int)[10]  */

	void *(*fp5)(int);        /* fp5 void *(*)(int)      */
	int (*(*fp6)(int))[10];  /* fp6 int[10] *(*)(int)   */

	fp2[0] = testfp2;
	fp5= testfp5;
	fp4[0] = testfp5;
        fp3 = test3;
/*fp1 和 fp6 還不知道是什麼東西*/
}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章