•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 456,489 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,710 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 1744 | Replies: 5 | Solved
![]() |
•
•
Join Date: Sep 2007
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 0
Hi, I'm using Microsoft Visual C++ and I keep getting this error referring to this one line in my main file . can someone HELP ME ?
#include <iostream>
using namespace std;
int main()
{
float tempFahrenheit;
float tempCelsius;
float Omrekenen;
cout << "Geef de temperatuur in Fahrenheit: ";
cin >> tempFahrenheit;
tempCelsius =Omrekenen(tempFahrenheit);
cout << "\n Dit is de temperatuur in Celsius: ";
cout << tempCelsius << endl;
return 0;
}
float Omrekenen(float tempFahrenheit)
{
float tempCelsius;
tempCelsius = (tempFahrenheit - 32)*5/9;
return tempCelsius;
} Just like variables, functions have to be declared before you use them:
#include <iostream>
using namespace std;
float Omrekenen(float tempFahrenheit);
int main()
{
float tempFahrenheit;
float tempCelsius;
float Omrekenen;
cout << "Geef de temperatuur in Fahrenheit: ";
cin >> tempFahrenheit;
tempCelsius =Omrekenen(tempFahrenheit);
cout << "\n Dit is de temperatuur in Celsius: ";
cout << tempCelsius << endl;
return 0;
}
float Omrekenen(float tempFahrenheit)
{
float tempCelsius;
tempCelsius = (tempFahrenheit - 32)*5/9;
return tempCelsius;
} I'm here to prove you wrong.
•
•
Join Date: Nov 2006
Location: Athens, Greece
Posts: 199
Reputation:
Rep Power: 3
Solved Threads: 9
•
•
•
•
im still having problems, with the code after declaring the function, same error massege
I don't know in what language you are writing, but the reason the compiler complained is that you used the word Omrekenen{what does it mean by the way?} as a function name and as a float...
i changed your code to::
c++ Syntax (Toggle Plain Text)
#include <iostream> using namespace std; float Omrekenen_func(float tempFahrenheit); int main() { float tempFahrenheit; float tempCelsius; float Omrekenen; cout << "Geef de temperatuur in Fahrenheit: "; cin >> tempFahrenheit; tempCelsius =Omrekenen_func(tempFahrenheit); cout << "\n Dit is de temperatuur in Celsius: "; cout << tempCelsius << endl; return 0; } float Omrekenen_func(float tempFahrenheit) { float tempCelsius; tempCelsius = (tempFahrenheit - 32)*5/9; return tempCelsius; }
and everything compiled fine!
Two roads diverged in a wood, and I— I took the one less traveled by, and that has made all the difference.
by Robert Frost the "The Road Not Taken"
by Robert Frost the "The Road Not Taken"
•
•
Join Date: Nov 2006
Location: Athens, Greece
Posts: 199
Reputation:
Rep Power: 3
Solved Threads: 9
![]() |
•
•
•
•
•
•
•
•
DaniWeb C++ Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- error C2064: term does not evaluate to a function taking 1 arguments (C++)
- Gettin C2064 error on a pretty simple program...Please help!! (C)
- error C2064: term does not evaluate to a function taking 1 arguments (C++)
Other Threads in the C++ Forum
- Previous Thread: Arrays Arrays Arrays
- Next Thread: Car dealer system



Linear Mode