int main()
{
float num;
num = GetData;
}
int GetData()
{
float num;
cout << "Enter the number you would like to evaluate: \n"
<< "(Number must be between 1,000,000 and -1,000,000.)";
cin >> num;
if (num > 1000000 || num < -1000000)
{
cout << "Please enter a number between 1,000,000 and -1,000,000.";
return 0;
}
else
{
return num;
}
}
I'm in my first term of programming classes so I'm probably missing something really simple. The error I'm getting is:
Error (active) E0513 a value of type "int (*)()" cannot be assigned to an entity of type "float"
I've tried changing the variable type and the return type of the function but the error persists. Like I said I'm new to this so it's probably something simple I'm overlooking.