题目内容

将一个函数指定为static存储类别后,该函数将( )。

A. 既可以被同一源文件中的函数调用,也可以被其他源文件中的函数调用
B. 只能被同一源文件中的函数调用,不能被其他源文件中的函数调用
C. 只能被其他源文件中的函数调用,不能被同一源文件中的函数调用
D. 既不能被同一源文件中的函数调用,也不能被其他源文件中的函数调用

查看答案
更多问题

以下叙述正确的是( )。

A. 全局变量的作用域一定比局部变量的作用域作用范围大
B. 静态static类型变量的生存期贯穿于整个程序的运行期间
C. 函数的形参都属于全局变量
D. 未在定义语句中赋初值的auto变量和static变量的初值都是随机值

#include int a,b;void fun(){ a=10;b=20;}void main(){ int a=3,b=9;fun();printf("%d,%d\n",a,b);}

以下程序输出结果为 。#include int f( ) //定义f函数,a为形参{int b=0; //定义b为自动变量static int c=3; //定义c为静态局部变量b=b+1;c=c+1;return b+c;}void main( ){int a1,a2;a1=f();a2=f();printf("%d,%d",a1,a2);}

以下程序输出结果为 。#include int fun(int n){ if(n==1) return 1;else return fun(n-1)+1;}void main(){ int i,j=0;for(i=1;i<3;i++)j+=fun(i);printf("%d\n",j);}

答案查题题库