1.

Solve : Quick Course C++?

Answer»

I am doing a quick course on C++ and the book told me to build a program.

However, each time I do so it generates this error:

Quote

d:\c++ weekend crash course\work\conversion.cpp(13) : error C2676: binary '>' : 'class istream_withassign' does not define this operator or a conversion to a type acceptable to the predefined operator
Error executing cl.exe.


The book is from 2000 and is called C++ Weekend Crash Course

I am using Microsoft Visual 6.0 C++ Standard Edition

What could that error possibly mean?

I have looked on the Internet, but what I found made no sense to me.

A friend of mine is doing the exact same with the same VERSION of Visal C++ and runs into the same error...

Here is the program I am told to recreate..

Code: [Select]//
// Program to convert temperature from Celsius degree
// units into Fahrenheit degree units:
// Fahrenheit = Celsius * (212 - 32)/100 + 32
//
#include <stdio.h>
#include <iostream.h>
int main(int nNumberofArgs, char* pszArgs[])
{
// enter the temperature in Celsius
int nCelsius;
cout << “Enter the temperature in Celsius:”;
cin > nCelsius;
// calculate conversion FACTOR for Celsius
// to Fahrenheit
int nFactor;
nFactor = 212 - 32;
// use conversion factor to convert Celsius
// into Fahrenheit values
int nFahrenheit;
nFahrenheit = nFactor * nCelsius/100 + 32;
// output the results
cout << “Fahrenheit value is:”;
cout << nFahrenheit;
return 0;
}


Copied from a .PDF document into a forum.. The layout's a BIT.... messy now.Code: [Select] cin > nCelsius;

Had to be

Code: [Select] cin >> nCelsius;

I wonder if they ever bother to DOUBLE check important things on SPELLING errors.. No wonder wars are started.As you've already found out.. a missing "" or ; can completely blow apart your app. Syntax is everything and spelling is huge. Happy learning.I am aware of that - however, this was not my fault:

cin > instead of cin >>

(The writer's Texan, and we all know what comes from Texas..)Quote
this was not my fault

A wise carpenter never blames his tools.Quote
A wise carpenter never blames his tools.




nice quote there Joleen Quote
nice quote

Indeed it is. As you'll probably know, Raptor and I frequently poke fun at each other both here and on MSN. No insult is intended except the friendly one found in any friendship.group hug


Discussion

No Comment Found