第7章函数x.pptVIP

  • 5
  • 0
  • 约1.13万字
  • 约 37页
  • 2017-11-15 发布于河北
  • 举报
第7章函数x

int p=1,q=5; float f1(int a) { int b,c; ……. } int f3() {….. } char c1,c2; char f2(int x,int y) { int i,j; …… } main() { int m,n; ……. } c1,c2的作用范围 p,q的作用范围 extern char c1,c2; extern char c1,c2; c1,c2 的作用范围 扩展后 c1,c2 的作用范围 扩展后 例子解析(2) int max(int x, int y) { int z; z=xy?x:y; return(z); } main() { extern int a,b; printf(max=%d,max(a,b)); } int a=13,b=-8; 运行结果:max=13 extern int a,b; int max() { int z; z=ab?a:b; return(z); } main() { printf(max=%d,max()); } int a=13,b=-8; 例 外部变量定义与说明 int a=3,b=5; max(int a, int b) { int c; c=ab?a:b; return(c)

文档评论(0)

1亿VIP精品文档

相关文档