試圖寫在我使用罪程序中使用罪,但一直收到錯誤訊息試圖對C++接收錯誤消息
「罪
錯誤:重載函數的一個以上的實例」罪「匹配參數列表」
任何想法我做錯了什麼?
#include <stdio.h>
``#include <math.h>
#define DEGREE 45
#define THREE 3
int
main(void)
{
double diagonal;
double length;
double volume;
double stands;
double volumeostands;
//Get # of stands
printf("How many stands will you be making? \n");
scanf("%d", &stands);
//Get diagonal//
printf("What is the diagonal of the cube? \n");
scanf("%d", &diagonal);
//Find length
length = diagonal * sin(double(DEGREE);
//Find volume
volume = 3(length);
//Multiply volume by number of stands
volumeostands = volume * stands;
//Display volume (for # of stands)
printf("Volume is %lf inches for %lf stands", &volumeostands, &stands);
return (0);
}
你能後的代碼,以便我們可以幫助? – Poriferous 2014-12-04 02:44:21
啊哈!所以問題是,「我的代碼是什麼?」。我猜測代碼中包含一個名爲「sin」的函數調用。 – 2014-12-04 02:49:28
您發佈的代碼不會編譯,並且有許多其他錯誤,比如使用'%d'而不是'%f'讀取/打印雙精度數據,並將值的地址傳遞給'printf'時它應該是值。請發佈一些正確的代碼。 – 2014-12-04 04:36:10