私のコードで何が間違っているのか分かりません。私は、挨拶メッセージが表示される関数と、単純な計算が行われる他の関数の2つの関数を作成しました。関数は1つの引数を取らない
#include "stdafx.h"
#include <iostream>
#include <Windows.h>
using namespace std;
void greetings();
int total();
int main()
{
void greetings();
int num1, num2, sum;
cout<<"Enter a number to calculate : ";
cin>>num1;
cout<<"Enter another number to add : ";
cin>>num2;
sum = num1 + num2;
cout<<"The total number is "<<total(sum)<<endl;
system("PAUSE");
return 0;
}
/*Every function is down here*/
void greetings(){
cout<<"Welcome to the function 5"<<endl;
cout<<"Here we will try to call many function as possible"<<endl;
}
int total(int a, int b){
return a + b;
}
私は、このエラーメッセージが表示されます:
機能は、これはあなたの問題である1つの引数
は 'Total'は、2つの引数を取り、あなたが唯一の – MotKohn
がエラーに関連していない供給しているが、主な'の内側:
あなたはこれを実行する必要があります'、' void greetings(); 'は単に' greetings(); 'でなければなりません。 –