vc++6.0 查错问题

来源:百度知道 编辑:UC知道 时间:2024/05/14 06:41:42
在VC++6.0里面在怎么查错 可以显示代码出错在哪一行里面
#include<stdio.h>
int val1,val2,val3;
int product(int x,int y);
int main(void)
{
//get the first numder
printf(Enter a numder between 1 and 100:");
scanf("%d",&val1);
//get the second number
printf(Enter anoeher number between 1 and 100:");
scanf("%d",&val2);
//calculate and display the prooduct
printf("%d times %d=%d\n",val1,val2,val3);
return 0;
}
//furction returns the product of the two values provided
int prodluct(int x,int y)
{
return(x*y);
}

编译后在下方会弹出Build窗口,双击错误提示可以自动跳到错误行.一般小错误都是错误行;但更多更多时候是在错误行的上下若干行上.你到时注意一下就行了.
这题就是两个printf括号中少了",还有就是少了val3=product(val1,val2);这句,否则product函数就没有意义了啊

#include<stdio.h>
int val1,val2,val3;
int product(int x,int y)
{
return(x*y);
}
int main(void)
{
//get the first number
printf("Enter a number between 1 and 100:");
scanf("%d",&val1);
//get the second number
printf("Enter another number between 1 and 100:");
scanf("%d",&val2);
val3=product(val1,val2);
//calculate and display the product
printf("%d times %d=%d\n",val1,val2,val3);
return 0;
}
//function returns the product of the two values provided

在代码窗口的下面有错误提示
双击错误提示可以自动跳到错误行
在看看错误提示可以查找错误
并没有计算
函数并没有使用
#include<stdio.h>
int val1,val2,val3;
int product(int x,int y);
int main(void)
{
//ge