静态参数

didijiji 2011-08-29 09:32:51
请问在C中可以定义静态(static)的形参吗?
我在TC 2.0中编译不通过,在VC 6.0中编译可以通过,这是为什么?
...全文
175 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
didijiji 2013-04-19
  • 打赏
  • 举报
回复
引用 9 楼 supermegaboy 的回复:
c99允许形参中的static,但用途是另外一回事。
你好,是哪一回事? 我现在用的VS 2010好像也支持static的形参。
didijiji 2012-11-28
  • 打赏
  • 举报
回复
引用 9 楼 supermegaboy 的回复:
c99允许形参中的static,但用途是另外一回事。
你好,是哪一回事? 我现在用的VS 2010好像也支持static的形参。
飞天御剑流 2011-08-29
  • 打赏
  • 举报
回复
c99允许形参中的static,但用途是另外一回事。
gold_water 2011-08-29
  • 打赏
  • 举报
回复
没必要这么做吧
AnYidan 2011-08-29
  • 打赏
  • 举报
回复
这个真不知道
不过有些 compiler 对不应该或不认识的 修饰符等视而不见
独自听枫 2011-08-29
  • 打赏
  • 举报
回复
神马作用?
sdudubing 2011-08-29
  • 打赏
  • 举报
回复
确实没遇到过静态形参
sea313081574 2011-08-29
  • 打赏
  • 举报
回复
没有听说过,什么概念?
至善者善之敌 2011-08-29
  • 打赏
  • 举报
回复
静态形参本身就是个错误概念~
pengzhixi 2011-08-29
  • 打赏
  • 举报
回复
If the declarator includes an identifier list, each declaration in the declaration list shall have at least one declarator, those declarators shall declare only identifiers from the identifier list, and every identifier in the identifier list shall be declared. An identifier declared as a typedef name shall not be redeclared as a parameter. The declarations in the declaration list shall contain no storage-class specifier other than register and no initializations.
luciferisnotsatan 2011-08-29
  • 打赏
  • 举报
回复
void fun(static int x){};
这个??还真没见过这种用法。

TC2.0是比VC6还古老的东西

69,371

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧