发信人: Nova_Zhao (以人为本),原信区: ustcbbs
标 题: Complex C Definitions
发信站: 中国科大BBS站 (Tue, 04 Apr 2000 13:37:29),站内信件
int i; // i as an int
int *i; // i as a pointer to an int
int **i; // i is a pointer to a pointer to an int
int *(*i)(); // i is a pointer to a function returning a pointer to int
int *(*i[])(); // i is an array of pointers to functions returning pointers to an int
int *i[5]; // i is an array of 5 pointers to int
int (*i)[5]; // i is a pointer to an array of 5 ints
int *i(); // i is a function returning a pointer to an int
int (*i)(); // i is a pointer to a function returning int
int *(*(*i)())[5]; // i is a pointer to a function returning a pointer to an array of 5 pointers to an int
--
※ 来源: 中国科大BBS站 [ bbs.ustc.edu.cn]
标 题: Complex C Definitions
发信站: 中国科大BBS站 (Tue, 04 Apr 2000 13:37:29),站内信件
int i; // i as an int
int *i; // i as a pointer to an int
int **i; // i is a pointer to a pointer to an int
int *(*i)(); // i is a pointer to a function returning a pointer to int
int *(*i[])(); // i is an array of pointers to functions returning pointers to an int
int *i[5]; // i is an array of 5 pointers to int
int (*i)[5]; // i is a pointer to an array of 5 ints
int *i(); // i is a function returning a pointer to an int
int (*i)(); // i is a pointer to a function returning int
int *(*(*i)())[5]; // i is a pointer to a function returning a pointer to an array of 5 pointers to an int
--
※ 来源: 中国科大BBS站 [ bbs.ustc.edu.cn]