最近看到两种C语言函数的写法(virant):

/* 1st virant */intfoo(inta){returna;}/* 2nd virant */intfoo(a)inta;{returna;}

简单地说是:1st virant是C99支持的语法方式,而2nd virant (Kernighan & Ritchie) C是老的C语言建议的写法,现在越来越不被支持了。

详细见:

The "2nd dialect" is called Kernighan & Ritchie C. It is the old C defined in the late 1970s (in the very first edition of a famous book on C by Kernighan and Ritchie; subsequent editions have been conforming to later C standards). It is an obsolete language.

Current compilers are often following the C99 ISO standard (published in 1999), which has been replaced by the new C11 standard (published in 2011).

GCC compilers are accepting the C99 standard with the -std=c99 program argument. I strongly suggest to compile with gcc -Wall -std=c99; Recent GCC compilers (ie 4.6 and 4.7) are accepting-std=c11 IIRC for the newer standard C11.

Don't code today in the old Kernighan and Ritchie C dialect: it is obsolete, and less and less supported by compilers. IMHO C99 is a good standard to follow if you are cautious. And take profit of some of its features (in particular, ability to mix declarations and statements inside a block; older C dialects required to put all the declarations at the start of a block.).

c语言函数的标准写法,C语言函数的两种写法变种相关推荐

  1. C语言程序设计之标准库快速排序qsort函数用法示例

    C语言程序设计之标准库快速排序qsort函数,排序效率高,使用方便,太棒了. qsort函数定义如下: #include <stdlib.h>void qsort(void *base, ...

  2. python装饰器带参数函数_python带参数装饰器的两种写法

    python带参数装饰器的两种写法 前言 最近在实现一个装饰器的过程中发现了一个很有意思的地方,在博客里面分享出来 不同的写法 三层函数嵌套,实现了可传参数的一个装饰器. import logging ...

  3. 【v-on】一个元素绑定多个事件以及一个事件绑定多个函数的两种写法

    本文代码主要讲述了v-on绑定事件函数传参,一个元素绑定多个事件的两种写法,一个事件绑定多个函数的两种写法,修饰符的使用. <!DOCTYPE html> <html lang=&q ...

  4. javascript中自执行(自调用)函数的两种写法

    自执行函数定义: 自执行函数或是自调用函数 声明完了,马上进行调用,只能使用一次,,有两种写法,举个栗子如下: 写法一: 格式:(函数)(实参) <script>(function (n1 ...

  5. JAVA是纯什么编程语言_JAVA,语言是纯编程语言,JAVA,程序分为两种

    JAVA,语言是纯编程语言,JAVA,程序分为两种 答: 面向对象;对象 Application;Java应用程序;应用程序 Applet;Java小程序;小程序 商业银行最重要的负债业务是 答:吸收 ...

  6. 两种写法的效果一样,那么到底哪一种更好呢?

    点击上方蓝色"程序猿DD",选择"设为星标" 回复"资源"获取独家整理的学习资料! 有时候,我们在写一些循环逻辑的时候,并不是按执行次数等作 ...

  7. Vue2基础-el与data的两种写法(HTML版)

    目录 一.el的2种写法 二.data的2种写法 三. 一个重要的原则 Vue2基础全套教程合集:点击跳转        Vue2高级全套教程合集:点击跳转 一.el的2种写法 new Vue时候配置 ...

  8. 二叉树结点的两种写法

    定义结点 typedef struct BTNode {int data;struct BTNode *lchild; //指向左孩子结点指针struct BTNode *rchild; //指向右孩 ...

  9. (五)Vue之data与el的两种写法

    文章目录 el的两种写法 data的两种写法 Vue学习目录 上一篇:(四)Vue之数据绑定 下一篇:(六)Vue之MVVC 容器: <div id="root">&l ...

  10. 从零学习Vue - 02模板语法、el与data两种写法、mvvm模型、数据代理

    root容器里的代码被称为模板,有了模板会有特殊的模板语法.Vue模板中语法有两大类,一类是插值语法,另一类是指令语法. 插值语法 功能:用于解析标签体内容.写法:{{xxx}},xxx为js表达式, ...

最新文章

  1. Google Test(GTest)使用方法和源码解析——死亡测试技术分析和应用
  2. 理解jQuery对象$.html
  3. RT-Thread GCC VSCode等开源工具链 在智能小车制作中的应用
  4. python培训费用-python培训费需要多少钱?
  5. (转)MySQL 服务器内存使用
  6. 理解分布式系统中的缓存架构(下)
  7. 【iVX 初级工程师培训教程 10篇文拿证】06 数据库及服务
  8. java xml格式打包,maven项目打包xml没有被打包解决办法 ,mybatis的xml打包
  9. 飞鸽传书内部护眼神功
  10. MySQL数据丢失情况分析
  11. 1066 图像过滤 (15 分)—PAT (Basic Level) Practice (中文)
  12. kubernetes 升级到1.6
  13. 【图像融合】基于matlab CBF算法图像融合【含Matlab源码 083期】
  14. 【ReflectDllInjection】 反射型DLL注入
  15. php录音功能,h5做出网页录音功能
  16. SOAP协议的深度解析
  17. 2021别再废掉了!学会这个用这个做PPT,高效神器保住你的发际线~
  18. Linux进程管理(redhat 8.0)
  19. nvidia-smi 查看显卡型号
  20. linux tail 命令 阿星小栈

热门文章

  1. 城市打印店一般几点开门?
  2. P1434 [SHOI2002]滑雪【记忆化搜索DP】
  3. element-ui表格的滚动条样式修改(当固定table表格高度时默认滚动条样式太丑)
  4. web前端入门学习路线{HTML+CSS+JavaScript}最全面的前端教程
  5. 第1课-如何有效学习和训练算法和数据结构
  6. Microsoft Word 论文编排技巧
  7. LED显示屏安装方法
  8. pyecharts 旋转折线图的X轴标签
  9. [EventKit] Error getting default calendar for new reminders: Error Domain=EKCADErrorDomain Code=1013
  10. 如何优雅使用JDK8中的Stream对list集合中的某值求和