![](https://csdnimg.cn/release/download_crawler_static/69819778/bg3.jpg)
integers)
g) 一个指向函数的指针,该函数有一个整型参数并返回一个整型数(A pointer
to a function that takes an integer as an argument and returns an
integer)
h) 一个有10个指针的数组,该指针指向一个函数,该函数有一个整型参数并返
回一个整型数( An array of ten pointers to functions that take an
integer argument and return an integer )
答案是:
a) int a; // An integer
b) int *a; // A pointer to an integer
c) int **a; // A pointer to a pointer to an integer
d) int a[10]; // An array of 10 integers
e) int *a[10]; // An array of 10 pointers to integers
f) int (*a)[10]; // A pointer to an array of 10 integers
g) int (*a)(int); // A pointer to a function a that takes an integer
argument and returns an integer
h) int (*a[10])(int); // An array of 10 pointers to functions that take
an integer argument and return an integer
人们经常声称这里有几个问题是那种要翻一下书才能回答的问题,我同意这
种说法。当我写这篇文章时,为了确定语法的正确性,我的确查了一下书。
但是当我被面试的时候,我期望被问到这个问题(或者相近的问题)。因为在被
面试的这段时间里,我确定我知道这个问题的答案。应试者如果不知道
所有的答案(或至少大部分答案),那么也就没有为这次面试做准备,如果该面
试者没有为这次面试做准备,那么他又能为什么出准备呢?
Static
6.
关键字 static 的作用是什么?
这个简单的问题很少有人能回答完全。在 C 语言中,关键字 static 有三个明
显的作用:
1). 在函数体,一个被声明为静态的变量在这一函数被调用过程中维持其值不
评论0
最新资源