By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,260 Members | 1,279 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,260 IT Pros & Developers. It's quick & easy.

I need help!

P: 8
I am writing a program that is calculating windchill but I have two errors that I need help with because I am a just learning how to program.

Program1.cpp:22: error: no match for ‘operator<<’ in ‘ (&std: :cin) ->std: :basic_istream<_CharT, _Traits>: :operator>> [with _CharT = char, _Traits = std: :char _traits<char>](((double&)(&dTemperature))) <<std: :endl’

Program1.cpp:24: error: no match for ‘operator<<’ in ‘ (&std: :cin) ->std: :basic_istream<_CharT, _Traits>: :operator>> [with _CharT = char, _Traits = std: :char _traits<char>](((double&)(&dwindspeed))) <<std: :endl’

So if anyone could tell me what these mean.
Feb 18 '07 #1
Share this Question
Share on Google+
3 Replies


Ganon11
Expert 2.5K+
P: 3,652
Could you post the code you are trying to compile? I expect you have made a typing error in your output statements.
Feb 18 '07 #2

P: 8
Could you post the code you are trying to compile? I expect you have made a typing error in your output statements.
Expand|Select|Wrap|Line Numbers
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main()
  6. (
  7.    char cAgain;
  8.    double fWindchill, fTemperature, fWindspeed;
  9.  
  10.    do     
  11.    (
  12.        cout.setf(ios: :fixed);
  13.        cout.setf(ios: :showpoint);   
  14.        cout.precision(4);
  15.        cout << endl << “Please enter temperature, in degrees Celcius”;
  16.        cin >> fTemperature << endl;
  17.        cout << endl << “Please enter windspeed, in meters/second” << endl;
  18.        cin >> fWindspeed << endl;
  19.        fwindchill = 13.12 + (o.6251 * fTemperature) – 11.37 * pow(fWindspeed, 0.16) + (0.3956 * pow(fWindspeed, 0.16));
  20.        cout << “Temperature is ” << fTemperature << “ degrees Celcius.”;
  21.        cout << “Windspeed is “ << fWindspeed << “ meters/second.”;
  22.        cout << “Windchill index is “ << fWindchill << “ degrees Celcius.”;
  23.        cout << endl << “Run this calculation again? Y/y/N/n” << endl;
  24.        cin >> cAgain;
  25.    )while (cAgain == ‘Y’ || cAgain == ‘y’);
  26.  
  27.    cout << endl << “Thankyou for using this program!” << endl;
  28.  
  29.    return 0;
  30.  
  31. )
I am not even sure if this is the correct way to calulate windchill, but if it can help me fix those errors i might be able to proceed with fixing it, thanks.
Feb 18 '07 #3

Ganon11
Expert 2.5K+
P: 3,652
The first two cin statements in your loop are what's giving you errors. In both cases, you use cin >> to input to a variable, but then you use << to try and output an endl. << can only be used with cout, the output device - cin is only used for input.
Feb 18 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.