delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/10/01/19:00:15

From: "Tamasin Ford" <tamasin AT home DOT com>
Newsgroups: comp.os.msdos.djgpp
References: <KgLB5.19967$P5 DOT 477644 AT news1 DOT rdc1 DOT ab DOT home DOT com> <mn5ftski0cf6memaa8c16hbea4uik4ui9i AT 4ax DOT com>
Subject: Re: Newby with an error
Lines: 43
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Message-ID: <RfPB5.20073$P5.488794@news1.rdc1.ab.home.com>
Date: Sun, 01 Oct 2000 22:53:37 GMT
NNTP-Posting-Host: 24.64.232.235
X-Complaints-To: abuse AT home DOT net
X-Trace: news1.rdc1.ab.home.com 970440817 24.64.232.235 (Sun, 01 Oct 2000 15:53:37 PDT)
NNTP-Posting-Date: Sun, 01 Oct 2000 15:53:37 PDT
Organization: Excite AT Home - The Leader in Broadband
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Here is a direct copy of the source:

//
// 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 fator to convert Celsius
  // into Fahrenheit values
  int nFahrenheit;
  nFahrenheit = nFactor * nCelsius/100 + 32;

  // output the results
  cout << "Fahrenheit value is:";
  cout << nFahrenheit;

  return 0;

}


The error is occuring on the line that says "cin > nCelsius;"

Thanks for looking at it for me. I have downloaded and am going to try the
NT patch you suggested.

Tamasin


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019