I keep getting these errors that say
'cout' undeclared (first use this function)and
'cin' undeclared (first use this function)but the coding is written exactly as in the example. I even tried it with the pre-made file and still get the same error.
Here is the code from the pre-made example file:
//
// Conversion - 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;
}
The two errors that I get are:
Error: error: 'cout' undeclared (first use this function)
Error: error: 'cin' undeclared (first use this function)
I'm using the latest software from DJGPP (which is the updated version of what comes with the book) for Win2K.
I am hoping that I'll have less problems with all of this once I get Visual Studio.NET running on my 'puter.
Thanks for all your help.

New Topic/Question
This topic is locked




MultiQuote






|