Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Quick Course C++  (Read 8189 times)

0 Members and 1 Guest are viewing this topic.

Raptor

  • Guest
Quick Course C++
« on: October 22, 2004, 02:20:55 PM »
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...

« Last Edit: October 23, 2004, 04:59:07 AM by Raptor »

Raptor

  • Guest
Re: Quick Course C++
« Reply #1 on: October 23, 2004, 04:58:06 AM »
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.

Raptor

  • Guest
Re: Quick Course C++
« Reply #2 on: October 23, 2004, 06:43:57 AM »
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.

Joleen

  • Guest
Re: Quick Course C++
« Reply #3 on: October 25, 2004, 06:02:11 AM »
As you've already found out.. a missing "" or ; can completely blow apart your app.  Syntax is everything and spelling is huge.  Happy learning.

Raptor

  • Guest
Re: Quick Course C++
« Reply #4 on: October 25, 2004, 06:51:08 AM »
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..)

Joleen

  • Guest
Re: Quick Course C++
« Reply #5 on: October 25, 2004, 06:54:38 AM »
Quote
this was not my fault

A wise carpenter never blames his tools.

shield

  • Guest
Re: Quick Course C++
« Reply #6 on: October 26, 2004, 10:04:48 PM »
Quote
A wise carpenter never blames his tools.




nice quote there Joleen :P

Joleen

  • Guest
Re: Quick Course C++
« Reply #7 on: October 27, 2004, 05:42:09 AM »
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.

Raptor

  • Guest
Re: Quick Course C++
« Reply #8 on: October 27, 2004, 06:34:40 AM »
group hug
« Last Edit: October 27, 2004, 06:48:15 AM by Raptor »