功能不明确

时间:2019-05-20 21:47:36

标签: c++

//我的编译器给出者错误为:    // Main.cpp:21:6:错误:对“ greater”的引用不明确            // a = Greater(num1);

#include<iostream>
using namespace std;
string greater(int num)
 {
    if(num>0)
    {
        return "Number is Positive";
    }
    else
    {
        return "Number is Negative";
    }
 }
int main()
 {


    string a;
        int num1;
        cout<<"Enter a number";cin>>num1;
        a = greater(num1);
        cout<<a;

 }

0 个答案:

没有答案