用ANSI C99标准如何写下面的c程序?

用ANSI C99标准如何写下面的c程序?,第1张

#include <stdio.h>

int max(int x,int y) //引用说渗穗液明放族迹在函数丛物外面。

void main ( )

{

int a, b, c

scanf ("%d,%d",&a,&b)

c=max (a,b)

printf ("max=%d",c)

}

int max(int x,int y)

{int z

if (x>y) z=x

else z=y

return (z)

}

gcc默认是不支持陆孙升c99及以上凯洞版早老本的 如果想支持,需要在编译时加参数:-std=c99 gcc -std=c99 -o xx xx.c 或者在源码里定义宏 #define __STDC_VERSION__ 199901L


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/12359392.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-24
下一篇 2023-05-24

发表评论

登录后才能评论

评论列表(0条)

保存