| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3253 人关注过本帖
标题:问?函数形参是否可定义为静态局部变量
取消只看楼主 加入收藏
czy455475537
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2011-4-12
结帖率:0
收藏
已结贴  问题点数:20 回复次数:1 
问?函数形参是否可定义为静态局部变量
#include <stdio.h>                                   |                   #include <stdio.h>
void swap()                                        |                   void swap()
main()                                               |                   main()
{                                                    |                   {
  int a=2,b=3                                       |                      int a=2,b=3
  swap(a,b)                                       |                      swap(a,b)
  printf(“a=%d,b=%d/n”,a,b)                   |                      printf(“a=%d,b=%d/n”,a,b)
}                                                    |                    }   
void swap(int x,int y)                               |                    void swap(static int x,static int y)  
{                                                    |                    {                             
  int temp                                           |                       int temp
  temp=x                                             |                       temp=x
  x=y                                                |                       x=y
  y=temp                                             |                       y=temp
  printf(x=%d,y=%d/n,x,y)                         |                       printf(x=%d,y=%d/n,x,y)
}                                                    |                       }

----------------------------------------------------------------------------------------------------------------------------------------

????
右边的形参可以定义为静态局部变量吗?
如可以,右边程序结果是什么,求解答
搜索更多相关主题的帖子: include 
2011-04-12 21:52
czy455475537
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2011-4-12
收藏
得分:0 
传值调用在右边程序中成立吗????
2011-04-12 22:22
快速回复:问?函数形参是否可定义为静态局部变量
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.059160 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved