warning C4508:

来源:百度知道 编辑:UC知道 时间:2024/06/16 16:19:19
我按照书上的程序编入C++6.0中,调试出现以下问题,帮忙看一下哪出错了,应该怎麼改:
#include<stdio.h>
main()
{int a,b,c,t;
printf("input a,b,c:");scanf("%d%d%d",&a,&b,&c);
printf("a=%d,b=%d,c=%d\n",a,b,c);
if(a>b)
{t=a;a=b;b=t;}
if(a>c)
{t=a;a=c;c=t;}
if(b>c)
{t=b;b=c;c=t;}
printf("%d,%d,%d\n",a,b,c);
}

Compiler Warning (level 1) C4508
'function' : function should return a value; void return type assumed

The given function did not specify a return type; the compiler assumed that the return type was void.

This warning can be avoided by declaring functions as void that do not return a value.

-------------
main加个

void main()

我还真没看出问题