我在 CodeBlocks 中不断收到一条错误消息,它说:
Error: 'Addnumbers' was not declared in this scope
我刚开始使用 C++,不知道这意味着什么。这是我的代码:
#include <iostream>
using namespace std;
int main()
{
int fnum;
int snum;
cout << "Enter First number" << endl;
cin >> fnum;
cout << "Enter Second Number" << endl;
cin >> snum;
Addnumbers (fnum, snum);
return 0;
}
int Addnumbers(int fnum, int snum){
int ans = fnum+snum;
return ans;
}